aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/eselect
blob: 0f2d6820f8d4938ac8bfa2659c5c3ff5b13eea1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

case "$(printf "new\nstop\nrestart\neshell\nmail" | dmenu -p "eserver: ")" in
    "restart")
        systemctl --user restart emacs;
        notify-send "eselect: Restarted Emacs server";;
    "stop")
        systemctl --user stop emacs;
        notify-send "eselect: Halted Emacs server";;
    "new")
        notify-send "eselect: Launching Emacs";
        emacsclient -c;;
    "eshell")
        notify-send "eselect: Launching Eshell";
        emacsclient -c --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';;
    "mail")
        notify-send "eselect: Launching notmuch";
        emacsclient -c --eval '(let ((b (or (get-buffer "*notmuch-hello*") (progn (notmuch) (get-buffer "*notmuch-hello*"))))) (switch-to-buffer b))';;
esac