diff --git a/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org b/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org index c46a713..03c5152 100644 --- a/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org +++ b/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org @@ -2,6 +2,8 @@ #+begin_src sh :tangle ~/Applications/Emacs.app/Contents/MacOS/Emacs :mkdirp yes :tangle-mode o755 #!/bin/sh - /opt/homebrew/bin/emacsclient -c &> /dev/null & - disown + if ! ps -e | grep -q '[E]macs --bg-daemon'; then + /opt/homebrew/bin/emacs --daemon + fi + /opt/homebrew/bin/emacsclient -c &> /dev/null #+end_src diff --git a/macos/Library/LaunchAgents/gnu.emacs.daemon.org b/macos/Library/LaunchAgents/gnu.emacs.daemon.org deleted file mode 100644 index f595c93..0000000 --- a/macos/Library/LaunchAgents/gnu.emacs.daemon.org +++ /dev/null @@ -1,23 +0,0 @@ -#+title: Emacs Daemon =launchd= Entry - -Create a =launchd= entry for Emacs daemon to run at login. -#+begin_src xml :tangle ~/Library/LaunchAgents/gnu.emacs.daemon.plist :mkdirp yes - - - - - Label - gnu.emacs.daemon - ProgramArguments - - /opt/homebrew/bin/emacs - --daemon - - RunAtLoad - - ServiceDescription - Gnu Emacs Daemon - - -#+end_src