From 1463ae72e5a9d058821cf93194aa31c929e600c5 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Tue, 26 Jul 2022 16:20:45 +0530 Subject: removed android stuff from dmenumount\umount scripts --- .local/bin/dmenumount | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to '.local/bin/dmenumount') diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index b414dc8..241e6fd 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -1,6 +1,6 @@ #!/bin/sh -# Gives a dmenu prompt to mount unmounted drives and Android phones. If +# Gives a dmenu prompt to mount unmounted drives. If # they're in /etc/fstab, they'll be mounted automatically. Otherwise, you'll # be prompted to give a mountpoint from already existsing directories. If you # input a novel directory, it will prompt you to create that directory. @@ -31,37 +31,11 @@ mountusb() { \ notify-send "💻 USB mounting" "$chosen mounted to $mp." } -mountandroid() { \ - chosen="$(echo "$anddrives" | dmenu -i -p "Which Android device?")" || exit 1 - chosen="$(echo "$chosen" | cut -d : -f 1)" - getmount "$HOME -maxdepth 3 -type d" - simple-mtpfs --device "$chosen" "$mp" - echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1 - simple-mtpfs --device "$chosen" "$mp" - notify-send "🤖 Android Mounting" "Android device mounted to $mp." - } - -asktype() { \ - choice="$(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")" || exit 1 - case $choice in - USB) mountusb ;; - Android) mountandroid ;; - esac - } - -anddrives=$(simple-mtpfs -l 2>/dev/null) usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | grep 'part\|rom' | awk '$4==""{printf "%s (%s)\n",$1,$3}')" if [ -z "$usbdrives" ]; then - [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit - echo "Android device(s) detected." - mountandroid + echo "No USB drive detected" && exit else - if [ -z "$anddrives" ]; then echo "USB drive(s) detected." mountusb - else - echo "Mountable USB drive(s) and Android device(s) detected." - asktype - fi -fi \ No newline at end of file +fi -- cgit v1.2.3