From 42feda400d8fd77e460aacca9e99af70c188b7c9 Mon Sep 17 00:00:00 2001 From: zachir Date: Mon, 27 Feb 2023 00:14:25 -0600 Subject: Add check to determine display server without flags --- fdc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fdc') diff --git a/fdc b/fdc index 2ad7b61..3c3a6bf 100755 --- a/fdc +++ b/fdc @@ -21,6 +21,19 @@ while getopts "hwxd:u:" o; do case "${o}" in esac done #}}} +#{{{ Check display server if -w or -x not provided +if [ -z "$DMENU" ]; then + if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="bemenu" + elif [ -n "$DISPLAY" ]; then + DMENU="dmene" + else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 + fi +fi +#}}} + #{{{ Choose Profiles PROFILES=`grep 'Path=' ~/.firedragon/profiles.ini | cut -d'.' -f2` CHOSEN=`echo "$PROFILES" | $DMENU -p "firedragon" -l 15 $DMENU_ARGS` -- cgit v1.2.3