subr: add default terminal

Tue, 07 Nov 2017 12:03:56 +0100

author
David Demelier <markand@malikania.fr>
date
Tue, 07 Nov 2017 12:03:56 +0100
changeset 8
e1e0929d3189
parent 7
dc00601519cd
child 9
cb9c1d42c201

subr: add default terminal

dmenu.subr file | annotate | diff | comparison | revisions
--- a/dmenu.subr	Tue Nov 07 11:54:31 2017 +0100
+++ b/dmenu.subr	Tue Nov 07 12:03:56 2017 +0100
@@ -27,6 +27,16 @@
     . ${XDG_CONFIG_HOME}/dmenutools.conf
 fi
 
+# Find a terminal.
+if [ -z "${term}" ]; then
+    for t in urxvt st terminator terminator xterm; do
+        if command -v ${t} > /dev/null 2>&1; then
+            term=${t}
+            break
+        fi
+    done
+fi
+
 #
 # dmt_fatal
 # -------------------------------------------------------------------

mercurial