unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Parvesh Monu <parvesh.dhullmonu@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 46704@debbugs.gnu.org
Subject: bug#46704: X clipboard is always empty with emacs server without emacsclient running
Date: Mon, 22 Feb 2021 21:22:57 +0530	[thread overview]
Message-ID: <CAMBz1fAynjMKrBJ9bOMagr-LgrXVMHcxEGTX7fgX-ePbwwR5mQ@mail.gmail.com> (raw)
In-Reply-To: <878s7gkv8s.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]

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 <larsi@gnus.org> wrote:

> Parvesh Monu <parvesh.dhullmonu@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 2040 bytes --]

  reply	other threads:[~2021-02-22 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22  8:37 bug#46704: X clipboard is always empty with emacs server without emacsclient running Parvesh Monu
2021-02-22 14:55 ` Lars Ingebrigtsen
2021-02-22 15:52   ` Parvesh Monu [this message]
2022-06-19 13:51   ` Lars Ingebrigtsen
2022-06-20  1:21     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMBz1fAynjMKrBJ9bOMagr-LgrXVMHcxEGTX7fgX-ePbwwR5mQ@mail.gmail.com \
    --to=parvesh.dhullmonu@gmail.com \
    --cc=46704@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).