changeset 8:e1e0929d3189

subr: add default terminal
author David Demelier <markand@malikania.fr>
date Tue, 07 Nov 2017 12:03:56 +0100
parents dc00601519cd
children cb9c1d42c201
files dmenu.subr
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
 # -------------------------------------------------------------------