summaryrefslogtreecommitdiff
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
parent75f7550e7e6ee03d1c03d2023b47ab47bb5ac4d2 (diff)
removed android stuff from dmenumount\umount scripts
-rw-r--r--.config/ncmpcpp/config3
-rwxr-xr-x.local/bin/dmenumount32
-rwxr-xr-x.local/bin/dmenuumount30
3 files changed, 10 insertions, 55 deletions
diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config
index 27995b7..0ebf410 100644
--- a/.config/ncmpcpp/config
+++ b/.config/ncmpcpp/config
@@ -32,6 +32,9 @@ statusbar_color = red
volume_color = "green"
statusbar_time_color = cyan:b
+## Selected tracks ##
+selected_item_prefix = "* "
+
## Seeking ##
incremental_seeking = "yes"
seek_time = "1"
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
diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount
index 946d12c..d9be444 100755
--- a/.local/bin/dmenuumount
+++ b/.local/bin/dmenuumount
@@ -12,33 +12,11 @@ unmountusb() {
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?")" || exit 1
- [ -z "$chosen" ] && exit
- sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted."
- }
-
-asktype() { \
- choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1
- case "$choice" in
- USB) unmountusb ;;
- Android) unmountandroid ;;
- esac
- }
-
drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}')
-if ! grep simple-mtpfs /etc/mtab; then
- [ -z "$drives" ] && echo "No drives to unmount." && exit
- echo "Unmountable USB drive detected."
- unmountusb
+if [ -z "$drives" ]; then
+ echo "No drives to unmount." && exit
else
- if [ -z "$drives" ]
- then
- echo "Unmountable Android device detected."
- unmountandroid
- else
- echo "Unmountable USB drive(s) and Android device(s) detected."
- asktype
- fi
+ echo "Unmountable USB drive detected."
+ unmountusb
fi