summaryrefslogtreecommitdiffstats
path: root/sxhkd/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsxhkd/.local/bin/em13
1 files changed, 13 insertions, 0 deletions
diff --git a/sxhkd/.local/bin/em b/sxhkd/.local/bin/em
new file mode 100755
index 0000000..6d087f3
--- /dev/null
+++ b/sxhkd/.local/bin/em
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -z "$DISPLAY" ]; then
+ IS_GRAPHICAL=true
+else
+ IS_GRAPHICAL=$(emacs --batch -Q --eval='(if (fboundp '"'"'tool-bar-mode) (message "true") (message "false"))' 2>&1)
+fi
+
+if $IS_GRAPHICAL; then
+ emacsclient -a "" -nc "$@"
+else
+ emacsclient -a "" -t "$@"
+fi