#!/bin/bash case "$(printf "new\nstop\nrestart" | dmenu -p "eserver: ")" in "restart") emacsclient -s MAIN --eval "(kill-emacs)"; notify-send "Halted Emacs server"; emacs --bg-daemon=MAIN; notify-send "Restarted Emacs server";; "stop") emacsclient -s MAIN --eval "(kill-emacs)"; notify-send "Halted Emacs server";; "new") notify-send "Launching Emacs"; emacsclient -s MAIN -c -a=emacs;; esac