Created
May 15, 2018 16:40
-
-
Save winny-/4344c423051b07d20bc0c1f567a2f067 to your computer and use it in GitHub Desktop.
This file contains 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 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