aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-07-25 02:37:20 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-07-25 02:37:20 +0100
commit571a896f7c2ccda279866f6ebe807c0d526bcc61 (patch)
tree12699a75ca210f9cc0b263e292e68dc54dcebbb8 /Scripts/.local/scripts
parented097b04821bcee1c725619ed4574fb4da8e2e05 (diff)
downloaddotfiles-571a896f7c2ccda279866f6ebe807c0d526bcc61.tar.gz
dotfiles-571a896f7c2ccda279866f6ebe807c0d526bcc61.tar.bz2
dotfiles-571a896f7c2ccda279866f6ebe807c0d526bcc61.zip
(Scripts)~fix eselect
Big issue with emacsclient when launching alternate editor with eval instructions: it considers the --eval Lisp code a file name, which it opens as a buffer. Instead, use -a "" which launches Emacs with daemon on if no daemon is running. Also, instead of using a SystemD service for Emacs, let's just manage it via emacsclient. Less dependence on it then.
Diffstat (limited to 'Scripts/.local/scripts')
-rwxr-xr-xScripts/.local/scripts/eselect11
1 files changed, 6 insertions, 5 deletions
diff --git a/Scripts/.local/scripts/eselect b/Scripts/.local/scripts/eselect
index 8f811b7..d3f62c9 100755
--- a/Scripts/.local/scripts/eselect
+++ b/Scripts/.local/scripts/eselect
@@ -2,18 +2,19 @@
case "$(printf "new\nstop\nrestart\neshell\nmail" | dmenu -p "eserver: ")" in
"restart")
- systemctl --user restart emacs;
+ emacsclient --eval "(save-buffers-kill-emacs)";
+ emacs --bg-daemon;
notify-send "eselect: Restarted Emacs server";;
"stop")
- systemctl --user stop emacs;
+ emacsclient --eval "(save-buffers-kill-emacs)";
notify-send "eselect: Halted Emacs server";;
"new")
notify-send "eselect: Launching Emacs";
- emacsclient -c -a "emacs";;
+ emacsclient -c -a "";;
"eshell")
notify-send "eselect: Launching Eshell";
- emacsclient -c -a "emacs" --eval '(progn (eshell) (delete-other-windows))';;
+ emacsclient -c -a "" --eval "(progn (eshell) (delete-other-windows))";;
"mail")
notify-send "eselect: Launching notmuch";
- emacsclient -c -a "emacs" --eval '(progn (notmuch) (delete-other-windows))';;
+ emacsclient -c -a "" --eval "(progn (notmuch) (delete-other-windows))";;
esac