From 8630746f6ec39c3280c61426ff09af57c8a953c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=A1zquez=20Acosta?= Date: Thu, 20 Nov 2025 16:08:27 +0100 Subject: [PATCH] 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. --- bin/omarchy-launch-editor | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/omarchy-launch-editor b/bin/omarchy-launch-editor index 7597cfccb2..bce59c51be 100755 --- a/bin/omarchy-launch-editor +++ b/bin/omarchy-launch-editor @@ -6,6 +6,14 @@ case "$EDITOR" in nvim | vim | nano | micro | hx | helix) exec omarchy-launch-tui "$EDITOR" "$@" ;; +emacs) + # If emacs.service is active open a new frame instead of a whole new emacs. + if systemctl --user is-active emacs.service >/dev/null 2>&1; then + exec setsid uwsm-app -- emacsclient -n -r "$@" + else + exec setsid uwsm-app -- emacs "$@" + fi + ;; *) exec setsid uwsm-app -- "$EDITOR" "$@" ;;