summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authoriStagnant <ghafarielias200676@gmail.com>2023-02-20 23:16:20 +0200
committeriStagnant <ghafarielias200676@gmail.com>2023-02-20 23:16:20 +0200
commit89f8506d85aa262ca009b2c2761cbffb0e1b6844 (patch)
tree850427b795d9b283dda78d47cd663aec26a90899 /.local
parent27c00576c283316ffd82e3572fd956c20c494cf1 (diff)
downloadeibhear-89f8506d85aa262ca009b2c2761cbffb0e1b6844.tar.gz
eibhear-89f8506d85aa262ca009b2c2761cbffb0e1b6844.tar.zst
eibhear-89f8506d85aa262ca009b2c2761cbffb0e1b6844.zip
Made mounter not show already mounted android devices in the mounting prompt
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/mounter5
1 files changed, 4 insertions, 1 deletions
diff --git a/.local/bin/mounter b/.local/bin/mounter
index 3b2a314..7eec8aa 100755
--- a/.local/bin/mounter
+++ b/.local/bin/mounter
@@ -11,6 +11,9 @@ set -e
# Check for phones.
phones="$(simple-mtpfs -l 2>/dev/null | sed "s/^/📱/")"
+for NUMBER in $(echo "$phones" | sed -rn 's/.([0-9]).*/\1/gp'); do
+ [[ $(sed -rn 's/simple-mtpfs-([0-9]).*/\1/gp' /etc/mtab) = $NUMBER ]] && phones="$(echo "$phones" | sed "/$NUMBER: .*/d")"
+done
# Check for drives.
lsblkoutput="$(lsblk -rpo "uuid,name,type,size,label,mountpoint,fstype")"
# Get all LUKS drives
@@ -94,7 +97,7 @@ case "$chosen" in
getmount
chosen="${chosen%%:*}"
chosen="${chosen:1}" # This is a bashism.
- sudo -A simple-mtpfs -o allow_other --device "$chosen" "$mp"
+ sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$chosen" --device "$chosen" "$mp"
notify-send "🤖 Android Mounted." "Android device mounted to $mp."
;;
esac