From cf0de5fee6da27798f68cab9a63ae257e4172bda Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 8 Jun 2015 23:30:44 -0400 Subject: launch Emacs in daemon mode --- sxhkd/.local/bin/em | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 sxhkd/.local/bin/em (limited to 'sxhkd/.local/bin/em') 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 -- cgit v1.2.3-60-g2f50