dmenu mount and umount fixes

This commit is contained in:
Luke Smith
2019-04-10 19:56:09 -04:00
parent b937082b98
commit 1f6dbfea03
2 changed files with 6 additions and 7 deletions

View File

@@ -7,17 +7,17 @@ unmountusb() {
[ -z "$drives" ] && exit
chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}')
[ -z "$chosen" ] && exit
sudo -A umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted."
}
unmountandroid() { \
chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
[ -z "$chosen" ] && exit
sudo -A umount -l "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted."
}
asktype() { \
case $(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?") in
case "$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" in
USB) unmountusb ;;
Android) unmountandroid ;;
esac