diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-03-25 09:58:31 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-03-25 09:58:31 +0000 |
commit | 4c019a179b57487f1fc106d1f4e8c2bef3f83c79 (patch) | |
tree | 151d34e9d5affcd91690b61ed71791b69250a911 | |
parent | c42a5342dd372234e527ba1aa818234da5b2f37d (diff) | |
download | dotfiles-4c019a179b57487f1fc106d1f4e8c2bef3f83c79.tar.gz dotfiles-4c019a179b57487f1fc106d1f4e8c2bef3f83c79.tar.bz2 dotfiles-4c019a179b57487f1fc106d1f4e8c2bef3f83c79.zip |
(Scripts)~use SystemD for eselect
Instead of random calls to emacsclient and emacs, just use systemd to
do it for me!
-rwxr-xr-x | Scripts/.local/scripts/eselect | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Scripts/.local/scripts/eselect b/Scripts/.local/scripts/eselect index fb8f515..5f11f5b 100755 --- a/Scripts/.local/scripts/eselect +++ b/Scripts/.local/scripts/eselect @@ -1,19 +1,17 @@ -#!/bin/bash +#!/bin/sh case "$(printf "new\nstop\nrestart\neshell" | dmenu -p "eserver: ")" in "restart") - emacsclient -s MAIN --eval "(kill-emacs)"; - notify-send "Halted Emacs server"; - emacs --bg-daemon=MAIN; + systemctl --user restart emacs; notify-send "Restarted Emacs server";; "stop") - emacsclient -s MAIN --eval "(kill-emacs)"; + systemctl --user stop emacs; notify-send "Halted Emacs server";; "new") notify-send "Launching Emacs"; - emacsclient -s MAIN -c -a=emacs;; + emacsclient --socket-name=MAIN -c --alternate-editor=emacs;; "eshell") notify-send "Launching Eshell"; - emacsclient -s MAIN -c -a=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) + emacsclient --socket-name=MAIN -c --alternate-editor=emacs --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))' esac |