Skip to content

Commit d199755

Browse files
committed
Use the running Emacs to open the editor.
When we install Emacs, we also enable the emacs.service; to avoid having two competing Emacs instances, let's open a frame if the service is running.
1 parent 9626408 commit d199755

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/omarchy-launch-editor

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ case "$EDITOR" in
66
nvim | vim | nano | micro | hx | helix)
77
exec omarchy-launch-tui "$EDITOR" "$@"
88
;;
9+
emacs)
10+
# If emacs.service is active running open a new frame instead of whole new
11+
# emacs.
12+
if systemctl --user is-active emacs.service >/dev/null 2>&1; then
13+
exec setsid uwsm-app -- emacsclient -n -r "$@"
14+
else
15+
exec setsid uwsm-app -- emacs "$@"
16+
fi
17+
;;
918
*)
1019
exec setsid uwsm-app -- "$EDITOR" "$@"
1120
;;

0 commit comments

Comments
 (0)