08.09.2020 12:21, Tim Cross wrote:

How you add this to a window manager menu or key binding will depend on
your window manager, but essentially, you just calling emacscleint with
the argument -e (org-capture). You may need to quote the command to
prevent shell interpolation of the command and you may need to add other
arguments, such as -n or --no-wait etc.

Good point. However playing with a script for org protocol, I realized that there could be no emacs frame yet, so I added --create-frame depending on output of

emacsclient --quiet --eval \
"(seq-some (lambda (f) (if (eq 'x (framep f)) 'has-frame 'no-frame)) (frame-list))" \
  2>&1

Another point is to provide feedback (notify-send, kdialog, zenity, etc.) if emacs server is not running at all (non-zero exit code of the shell command above). Though since Samuel is already using org-protocol, it should not be a problem.


Reply via email to