summaryrefslogtreecommitdiff
path: root/.local/bin/dmenumount
diff options
context:
space:
mode:
authorkrolyxon <krolyxon@tutanota.com>2022-07-26 16:20:45 +0530
committerkrolyxon <krolyxon@tutanota.com>2022-07-26 16:20:45 +0530
commit1463ae72e5a9d058821cf93194aa31c929e600c5 (patch)
treee836f5217e3e37b885322fb0b261a24b0498b6a0 /.local/bin/dmenumount
parent75f7550e7e6ee03d1c03d2023b47ab47bb5ac4d2 (diff)
removed android stuff from dmenumount\umount scripts
Diffstat (limited to '.local/bin/dmenumount')
-rwxr-xr-x.local/bin/dmenumount32
1 files changed, 3 insertions, 29 deletions
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