Hi,Is it possible to get display of an emacsclient process? I mean either --display option argument or the DISPLAY environment variable namely for the client. Unfortunately the value of following expression is the DISPLAY environment of the server process
emacsclient --eval '(getenv "DISPLAY")' I admit, it should work in most cases, but it is not robust: DISPLAY= emacs --daemon --display :0causes empty string returned by `getenv'. In general, emacsclient's display is not necessary the same as the server's one. If I have got it correctly, the value is passed from client to server and there is a local "display" variable in server.el hidden from evaluated expression. The context of the question is the following. Org-capture allows to create notes in non-distracting way (by setting :immediate-finish t property of the capture template). The idea is to save text currently selected in some application (either PRIMARY or CLIPBOARD) using a global window manager shortcut invoking
emacsclient --eval '(org-capture nil "x")'There is a pitfall. Emacs daemon has no frame at startup, so selection is inaccessible:
emacsclient --eval "(org-get-x-clipboard 'PRIMARY)"returns nil (it is merely a convenient way to call `gui-get-selection'). A workaround is to call `server-select-display', but to do so it is necessary to know display. That is why I am asking how to obtain display of emacsclient.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4