Skip to content

Commit 8630746

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 a810608 commit 8630746

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/omarchy-launch-editor

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ 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 open a new frame instead of a whole new emacs.
11+
if systemctl --user is-active emacs.service >/dev/null 2>&1; then
12+
exec setsid uwsm-app -- emacsclient -n -r "$@"
13+
else
14+
exec setsid uwsm-app -- emacs "$@"
15+
fi
16+
;;
917
*)
1018
exec setsid uwsm-app -- "$EDITOR" "$@"
1119
;;

0 commit comments

Comments
 (0)