On 28/10/2022 11:59, Samuel Wales wrote:
i launch emacs from xinit or fluxbox menu. sometimes from a shell. i
run emacs as a cli batch thing from a shell.
Then you should always have an X11 Emacs frame, maybe behind other
windows, and the following command should work
emacsclient --eval '(org-capture nil "p")'
with appropriate template key name, e.g. as defined by the following
silly example:
("p" "primary" entry
(file "/tmp/capture-test.org")
"* Primary
%U
%(org-get-x-clipboard 'PRIMARY)
"
:immediate-finish t)
However to be at the safe side I would check if (org-get-x-clipboard
'PRIMARY) value is not nil at first.