summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <me@aminb.org>2015-06-08 23:30:44 -0400
committerAmin Bandali <me@aminb.org>2015-06-08 23:30:44 -0400
commitcf0de5fee6da27798f68cab9a63ae257e4172bda (patch)
tree673c906b006c2c74f58274ad6faef1365e48ccb9
parent097b0690a664a3b28896afa9390d99ad76030910 (diff)
downloadconfigs-cf0de5fee6da27798f68cab9a63ae257e4172bda.tar.gz
configs-cf0de5fee6da27798f68cab9a63ae257e4172bda.tar.xz
configs-cf0de5fee6da27798f68cab9a63ae257e4172bda.zip
launch Emacs in daemon mode
-rw-r--r--sxhkd/.config/sxhkd/sxhkdrc2
-rwxr-xr-xsxhkd/.local/bin/em13
-rwxr-xr-xx/.xprofile2
3 files changed, 15 insertions, 2 deletions
diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc
index 013eea9..0b98505 100644
--- a/sxhkd/.config/sxhkd/sxhkdrc
+++ b/sxhkd/.config/sxhkd/sxhkdrc
@@ -90,7 +90,7 @@ super + x
slimlock
super + e
- emacs
+ em
super + r
firefox
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
diff --git a/x/.xprofile b/x/.xprofile
index c91f71a..cbaeed0 100755
--- a/x/.xprofile
+++ b/x/.xprofile
@@ -72,6 +72,7 @@ xfdesktop --disable-wm-check &
xfce4-panel --disable-wm-check &
bspwm &
sxhkd &
+emacs --daemon &
sleep 2 && pnmixer &
# panel &
@@ -81,4 +82,3 @@ sleep 2 && pnmixer &
# bspwm) exec bspwm;;
# *) exec $DEFAULTSESSION ;;
# esac
-