Created
September 6, 2018 19:00
-
-
Save winny-/dfa59bec54ce8e6fa74efbfb4986cbe4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun winny/raise-or-create-window-system-frame (display) | |
"Raise an existing frame in the window system or create a new one." | |
(let ((frames (seq-filter #'(lambda (f) (frame-parameter f 'display)) (frame-list)))) | |
(if (null frames) | |
(make-frame `((window-system . x) | |
(display . ,display))) | |
(select-frame-set-input-focus (car frames))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
emacsclient -n -e "$(printf -- '(winny/raise-or-create-window-system-frame "%s")' "$DISPLAY")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment