From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Parvesh Monu Newsgroups: gmane.emacs.bugs Subject: bug#46704: X clipboard is always empty with emacs server without emacsclient running Date: Mon, 22 Feb 2021 21:22:57 +0530 Message-ID: References: <6482e65d-de70-6fbe-a0c9-89cb39e3082b@gmail.com> <878s7gkv8s.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003fc53305bbeecce5" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29816"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46704@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 22 16:54:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEDXG-0007UJ-OP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Feb 2021 16:54:10 +0100 Original-Received: from localhost ([::1]:52718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEDXF-0002sG-KB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Feb 2021 10:54:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEDX7-0002oU-TR for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2021 10:54:01 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEDX7-0002r7-MR for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2021 10:54:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEDX7-0000x0-LN for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2021 10:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Parvesh Monu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Feb 2021 15:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46704 X-GNU-PR-Package: emacs Original-Received: via spool by 46704-submit@debbugs.gnu.org id=B46704.16140091953584 (code B ref 46704); Mon, 22 Feb 2021 15:54:01 +0000 Original-Received: (at 46704) by debbugs.gnu.org; 22 Feb 2021 15:53:15 +0000 Original-Received: from localhost ([127.0.0.1]:57261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEDWM-0000vk-VG for submit@debbugs.gnu.org; Mon, 22 Feb 2021 10:53:15 -0500 Original-Received: from mail-pl1-f171.google.com ([209.85.214.171]:43235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEDWL-0000vT-0Z for 46704@debbugs.gnu.org; Mon, 22 Feb 2021 10:53:14 -0500 Original-Received: by mail-pl1-f171.google.com with SMTP id 17so4683936pli.10 for <46704@debbugs.gnu.org>; Mon, 22 Feb 2021 07:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kU6sGN3lnU1IPgJnOaXNfVFAjQWcXBzMRkTnvyu9OPA=; b=nJsnGOmav9W2OLOua3ZbPjZy0fqSb7CYZyiWjui3hHBiYNxwxMPwjSyyealnvhHF+Z 8hKq/+w/uEuqk8Q06m9JjKCuSHXQkn/rYGF8h5DRV/PcZ7xydDXzE6XpfeUj5FRL9wMW MAFX3fpg2k6MhdmLvxX3IKZIq5Z6A4aLAI25scbSk0OjcBylDOguVAJfppH2YUbf+Pu9 aln+1ojKQHBpn+qBfGiMPndwnJsKMFMrQRcBgxltZbdkEIVQ5+1S/ploRF3FHRMVpSCj Q5lLD132EZLjq3NDHPV+aF93jIq7cp6/IImsZMCgCgeDlfuiw8spPpIBOOhSohe1DetH WveA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kU6sGN3lnU1IPgJnOaXNfVFAjQWcXBzMRkTnvyu9OPA=; b=VAwiIjVSI5Jcp9lTf9gOYZ//1j9ie2V8Av+DmL25BFMzx8/2FqYyYEMV4yqlg2K2xG 83xC3UhC2eEg5l+eeh6XHH3yIUsCWMzdIWoEZOp1HTPhJiWZHZnP0iLe9SVOrStPEM1z /fgifdlNn10akG2R0Bamy8rgm/pib7QvSNzTqiNv4vQaC2bflJYB/04p70Ft4hTyv1Kv vWTiMtcKbBmO0audVndThQ7cQysRAmutWT+WNapVzLp2aRymtgwOlOfOyAe+aJTx4PEg PuEFqPfw0gQO/UeNXFVXZuN64ds0MPnLxdhTe+yDjE3aHHr0ZI06iwbQ3YGcOzjfqPgH m5tg== X-Gm-Message-State: AOAM532I98VGVXu13nTHD83VSN9LRe3oqOzhYdN35wK62coPzFWIm9We N95/p8MjHQZfDRZjiaWDHMrO45FumXa/1Igcrv0= X-Google-Smtp-Source: ABdhPJwVmoct8QNphkCBjLSsS9ogdBHzQzR1V68/m2vjpsGbfetjrx/VwPLmUg2IVlMMGWGCxZpDAZxppJcd+3suxv0= X-Received: by 2002:a17:902:aa8f:b029:e3:df7f:fd51 with SMTP id d15-20020a170902aa8fb02900e3df7ffd51mr10370045plr.71.1614009186893; Mon, 22 Feb 2021 07:53:06 -0800 (PST) In-Reply-To: <878s7gkv8s.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200591 Archived-At: --0000000000003fc53305bbeecce5 Content-Type: text/plain; charset="UTF-8" I don't know if it will help, but I found workaround to capture X-clipboard. Since %x doesn't work with daemon, I used %i and passed X-clipboard's content using xsel. Like, xdg-open "org-protocol://capture?template=h&body=`xsel`" On Mon, Feb 22, 2021, 8:25 PM Lars Ingebrigtsen wrote: > Parvesh Monu writes: > > > I have this template which captures clipboard content in file. It works > fine when > > emacsclient is running, but if no client is running then server adds > empty entry. > > > > (add-to-list 'org-capture-templates > > '("x" "Clips" entry (file+headline "/home/user/desktop/clips" > "Clips") > > "** %x" :immediate-finish t :prepend t)) > > I'm not quite sure I understand you correctly here -- but I think you're > saying that if you start "emacs --daemon", then that daemonised Emacs > can't communicate with the X clipboard? > > I'm not sure, but doesn't that sound quite natural? If you don't have > an X window open, then you can't talk to the X server, so you can't > access the clipboard, either. > > I don't know how Org is talking to the clipboard, though. Anybody? > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --0000000000003fc53305bbeecce5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I don't know if it will help, but I= found workaround to capture X-clipboard.

=
Since %x doesn't work with daemon, I used %i and pass= ed X-clipboard's content using xsel. Like,

<= /div>
xdg-open "org-protocol://capture?template=3Dh&a= mp;body=3D`xsel`"

On Mon, Feb 22, 2021, 8:25 PM Lars Ingebrigts= en <larsi@gnus.org> wrote:
<= /div>
Parvesh Monu <parvesh.dhull= monu@gmail.com> writes:

> I have this template which captures clipboard content in file. It work= s fine when
> emacsclient is running, but if no client is running then server adds e= mpty entry.
>
> (add-to-list 'org-capture-templates
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 '("x" "Clips" entry= (file+headline "/home/user/desktop/clips" "Clips")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "** %x" :immediate-finish = t :prepend t))

I'm not quite sure I understand you correctly here -- but I think you&#= 39;re
saying that if you start "emacs --daemon", then that daemonised E= macs
can't communicate with the X clipboard?

I'm not sure, but doesn't that sound quite natural?=C2=A0 If you do= n't have
an X window open, then you can't talk to the X server, so you can't=
access the clipboard, either.

I don't know how Org is talking to the clipboard, though.=C2=A0 Anybody= ?

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--0000000000003fc53305bbeecce5--