(SystemD)~emacs service to not use a name for the daemon
In hindsight, what other daemon am I going to be using for Emacs? It's not like I'll be starting two different servers! Even if I was, Emacs has the ability to assign a new unique name for the server depending on if another server is already running. Also, having a name for the main server makes it harder for other services (such as notmuch-mua.service) to find your Emacs instance.
This commit is contained in:
@@ -9,9 +9,8 @@ case "$(printf "new\nstop\nrestart\neshell" | dmenu -p "eserver: ")" in
|
|||||||
notify-send "Halted Emacs server";;
|
notify-send "Halted Emacs server";;
|
||||||
"new")
|
"new")
|
||||||
notify-send "Launching Emacs";
|
notify-send "Launching Emacs";
|
||||||
emacsclient --socket-name=MAIN -c --alternate-editor=emacs;;
|
emacsclient -c --alternate-editor=emacs;;
|
||||||
"eshell")
|
"eshell")
|
||||||
notify-send "Launching Eshell";
|
notify-send "Launching Eshell";
|
||||||
emacsclient --socket-name=MAIN -c --alternate-editor=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell))))
|
emacsclient -c --alternate-editor=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';;
|
||||||
(switch-to-buffer b))'
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ Description=Emacs
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
ExecStart=/usr/bin/emacs --bg-daemon=MAIN
|
ExecStart=/usr/local/bin/emacs --bg-daemon
|
||||||
ExecStop=/usr/bin/emacsclient --socket-name=MAIN --eval "(kill-emacs)"
|
ExecStop=/usr/local/bin/emacsclient --eval "(kill-emacs)"
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
TimeoutStartSec=0
|
TimeoutStartSec=0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user