Instead of random calls to emacsclient and emacs, just use systemd to do it for me!
18 lines
655 B
Bash
Executable File
18 lines
655 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 --socket-name=MAIN -c --alternate-editor=emacs;;
|
|
"eshell")
|
|
notify-send "Launching Eshell";
|
|
emacsclient --socket-name=MAIN -c --alternate-editor=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell))))
|
|
(switch-to-buffer b))'
|
|
esac
|