random-scripts/emacs-server-set-wayland-display.zsh

13 lines
391 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env zsh
setopt rcquotes
printf '%s' "${WAYLAND_DISPLAY}" |
/usr/bin/emacs --batch --insert=/dev/fd/0 \
--eval \
'(let ((wayland-display (buffer-string)))
(require ''server)
(server-eval-at
"server"
`(setenv "WAYLAND_DISPLAY" ,wayland-display)))'