aboutsummaryrefslogtreecommitdiff
path: root/bin/ek
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-03-20 18:41:45 +0800
committerGuangxiong Lin <[email protected]>2022-03-20 18:41:45 +0800
commite64253adc84b62a01660e7de276ba61711f7421f (patch)
tree366c84346d3097fa99a6dca6b29350d5c8b53681 /bin/ek
parent630a82c2f5c242c81671c823e7e88a95f232c7ab (diff)
downloaddotfiles-e64253adc84b62a01660e7de276ba61711f7421f.tar.gz
dotfiles-e64253adc84b62a01660e7de276ba61711f7421f.tar.bz2
dotfiles-e64253adc84b62a01660e7de276ba61711f7421f.zip
Improve emacsclient
Diffstat (limited to 'bin/ek')
-rwxr-xr-xbin/ek12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/ek b/bin/ek
new file mode 100755
index 0000000..4420327
--- /dev/null
+++ b/bin/ek
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+server_running () {
+ emacsclient -a "false" -e "(boundp 'server-process)"
+}
+
+if [ "t" == "$(server_running)" ]; then
+ emacsclient -e '(kill-emacs)'
+ echo "Emacs server is killed"
+else
+ echo "Emacs server is not running"
+fi