aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2021-07-25 15:34:18 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2021-07-25 15:44:48 +0100
commite5cc2ec33db5b674eda80c5ba45230889e64932e (patch)
tree35c6cd788accbbff810e90474e8e98043a6cff9e
parent1aa826227e052fb2f62df54b1599ec883df01799 (diff)
downloaddotfiles-e5cc2ec33db5b674eda80c5ba45230889e64932e.tar.gz
dotfiles-e5cc2ec33db5b674eda80c5ba45230889e64932e.tar.bz2
dotfiles-e5cc2ec33db5b674eda80c5ba45230889e64932e.zip
(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.
-rwxr-xr-xScripts/.local/scripts/eselect5
-rw-r--r--SystemD/.config/systemd/user/emacs.service4
2 files changed, 4 insertions, 5 deletions
diff --git a/Scripts/.local/scripts/eselect b/Scripts/.local/scripts/eselect
index 5f11f5b..d086b7e 100755
--- a/Scripts/.local/scripts/eselect
+++ b/Scripts/.local/scripts/eselect
@@ -9,9 +9,8 @@ case "$(printf "new\nstop\nrestart\neshell" | dmenu -p "eserver: ")" in
notify-send "Halted Emacs server";;
"new")
notify-send "Launching Emacs";
- emacsclient --socket-name=MAIN -c --alternate-editor=emacs;;
+ emacsclient -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))'
+ emacsclient -c --alternate-editor=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';;
esac
diff --git a/SystemD/.config/systemd/user/emacs.service b/SystemD/.config/systemd/user/emacs.service
index d7ba157..3c98bfb 100644
--- a/SystemD/.config/systemd/user/emacs.service
+++ b/SystemD/.config/systemd/user/emacs.service
@@ -3,8 +3,8 @@ Description=Emacs
[Service]
Type=forking
-ExecStart=/usr/bin/emacs --bg-daemon=MAIN
-ExecStop=/usr/bin/emacsclient --socket-name=MAIN --eval "(kill-emacs)"
+ExecStart=/usr/local/bin/emacs --bg-daemon
+ExecStop=/usr/local/bin/emacsclient --eval "(kill-emacs)"
Restart=on-failure
TimeoutStartSec=0