From 7a28e20e827023e71ae8d694e35090a174d7da21 Mon Sep 17 00:00:00 2001
From: Aryadev Chavali <aryadev@aryadevchavali.com>
Date: Mon, 21 Sep 2020 22:11:00 +0100
Subject: (Scripts)~eserver -> eselect

Remove eserver cos it's useless and integrate emacsclient into eselect
---
 Scripts/.local/scripts/eselect | 12 +++++++-----
 Scripts/.local/scripts/eserver | 22 ----------------------
 2 files changed, 7 insertions(+), 27 deletions(-)
 delete mode 100755 Scripts/.local/scripts/eserver

(limited to 'Scripts')

diff --git a/Scripts/.local/scripts/eselect b/Scripts/.local/scripts/eselect
index 8eabef8..5fc8415 100755
--- a/Scripts/.local/scripts/eselect
+++ b/Scripts/.local/scripts/eselect
@@ -2,12 +2,14 @@
 
 case "$(printf "new\nstop\nrestart" | dmenu -p "eserver: ")" in
     "restart")
-        eserver restart;
-        notify-send "Restarted eserver";;
+        emacsclient -s MAIN --eval "(kill-emacs)";
+        notify-send "Halted Emacs server";
+        emacs --bg-daemon=MAIN;
+        notify-send "Restarted Emacs server";;
     "stop")
-        eserver stop;
-        notify-send "Halted eserver";;
+        emacsclient -s MAIN --eval "(kill-emacs)";
+        notify-send "Halted Emacs server";;
     "new")
         notify-send "Launching Emacs";
-        eserver --create-frame -a=emacs;;
+        emacsclient -s MAIN -c -a=emacs;;
 esac
diff --git a/Scripts/.local/scripts/eserver b/Scripts/.local/scripts/eserver
deleted file mode 100755
index 309df99..0000000
--- a/Scripts/.local/scripts/eserver
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env sh
-
-if [ $1 = "restart" ]
-then
-    eserver stop
-    eserver start
-elif [ $1 = "start" ]
-then
-    if [ -e "/tmp/emacs-server" ]
-    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
-- 
cgit v1.2.3-13-gbd6f