From 187a18feb73ac9a1513a6100a1ffdb5f29f3debe Mon Sep 17 00:00:00 2001 From: zachir Date: Mon, 27 Feb 2023 00:21:09 -0600 Subject: change dmenu books, mount/umount, unicode to use bemenu and not need -w -x flag --- dmenuunicode | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'dmenuunicode') diff --git a/dmenuunicode b/dmenuunicode index d994614..1358fad 100755 --- a/dmenuunicode +++ b/dmenuunicode @@ -7,14 +7,25 @@ printhelp () { } while getopts "hwxd:" o; do case "${o}" in - w) DMENU="tofi" ;; + w) DMENU="bemenu" ;; x) DMENU="dmenu" ;; d) ARGS="$ARGS$OPTARG " ;; *) printhelp ;; esac done +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 + # Get user selection via dmenu -i -l 30 from emoji file. -chosen=$(cut -d ';' -f1 ~/.local/share/larbs/chars/* | $DMENU $ARGS | sed "s/ .*//") +chosen=$(cut -d ';' -f1 ~/.local/share/larbs/chars/* | $DMENU -l 10 $ARGS | sed "s/ .*//") # Exit if none chosen. [ -z "$chosen" ] && exit -- cgit v1.2.3