aboutsummaryrefslogtreecommitdiff
path: root/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts')
-rwxr-xr-xScripts/.local/scripts/eserver22
1 files changed, 22 insertions, 0 deletions
diff --git a/Scripts/.local/scripts/eserver b/Scripts/.local/scripts/eserver
new file mode 100755
index 0000000..b613bba
--- /dev/null
+++ b/Scripts/.local/scripts/eserver
@@ -0,0 +1,22 @@
+#!/usr/bin/env sh
+
+if [ $1 = "restart" ]
+then
+ eserver stop
+ eserver start
+elif [ $1 = "start" ]
+then
+ if [ -e "/tmp/emacs-server-id" ]
+ then
+ echo "Server running already!"
+ else
+ emacs --bg-daemon=MAIN
+ touch /tmp/emacs-server
+ fi
+elif [ $1 = "stop" ]
+then
+ eserver --eval "(kill-emacs)"
+ rm /tmp/emacs-server
+else
+ emacsclient -s MAIN $@
+fi