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.
17 lines
567 B
Bash
Executable File
17 lines
567 B
Bash
Executable File
#!/bin/sh
|
|
|
|
case "$(printf "new\nstop\nrestart\neshell" | dmenu -p "eserver: ")" in
|
|
"restart")
|
|
systemctl --user restart emacs;
|
|
notify-send "Restarted Emacs server";;
|
|
"stop")
|
|
systemctl --user stop emacs;
|
|
notify-send "Halted Emacs server";;
|
|
"new")
|
|
notify-send "Launching Emacs";
|
|
emacsclient -c --alternate-editor=emacs;;
|
|
"eshell")
|
|
notify-send "Launching Eshell";
|
|
emacsclient -c --alternate-editor=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';;
|
|
esac
|