From 6e72884bb5d0d046b37df86aedad33f0f60557f3 Mon Sep 17 00:00:00 2001 From: zachir Date: Wed, 16 Aug 2023 13:20:22 -0500 Subject: We use tofi now, it's fixed --- dmenuumount | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'dmenuumount') diff --git a/dmenuumount b/dmenuumount index 3b4ef61..4af0394 100755 --- a/dmenuumount +++ b/dmenuumount @@ -8,40 +8,38 @@ printhelp () { exit } -while getopts "hwxd:" o; do case "${o}" in - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; +while getopts "hd:" o; do case "${o}" in d) ARGS="$ARGS$OPTARG " ;; *) printhelp ;; esac done -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="-l 15 -p" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi unmountusb() { [ -z "$drives" ] && exit - chosen="$(echo "$drives" | $DMENU -l 10 $ARGS -p "Unmount which drive?")" || exit 1 + chosen="$(echo "$drives" | $DMENU $DEFARGS "Unmount which drive?" $ARGS)" || exit 1 chosen="$(echo "$chosen" | awk '{print $1}')" [ -z "$chosen" ] && exit doas umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted." } unmountandroid() { \ - chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | $DMENU -l 10 $ARGS -p "Unmount which device?")" || exit 1 + chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | $DMENU $DEFARGS "Unmount which device?" $ARGS )" || exit 1 [ -z "$chosen" ] && exit doas umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted." } asktype() { \ - choice="$(printf "USB\\nAndroid" | $DMENU -l 10 $ARGS -p "Unmount a USB drive or Android device?")" || exit 1 + choice="$(printf "USB\\nAndroid" | $DMENU $DEFARGS "Unmount a USB drive or Android device?" $ARGS)" || exit 1 case "$choice" in USB) unmountusb ;; Android) unmountandroid ;; -- cgit v1.2.3