summaryrefslogtreecommitdiffstats
path: root/sxhkd/.local/bin/em
blob: 6d087f3e346d3feaa0f7ac018afbf5bbb2164ed7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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