summaryrefslogtreecommitdiff
path: root/ar/.local/bin/mounter
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-12 03:04:54 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-12 03:04:54 +0900
commitf6a3b6ccb678823f1296b95c38c4fad4c895b0f2 (patch)
tree01b402bb866d32fc102f6b62be16a595c8d2d278 /ar/.local/bin/mounter
parentf05df438de35317224ac3a8d17cf3dfd062851b9 (diff)
modified qutebrowser/config.py, modified bin/mounter, modified bin/unmounter
Diffstat (limited to 'ar/.local/bin/mounter')
-rwxr-xr-xar/.local/bin/mounter20
1 files changed, 19 insertions, 1 deletions
diff --git a/ar/.local/bin/mounter b/ar/.local/bin/mounter
index 6f294d2..026f9b3 100755
--- a/ar/.local/bin/mounter
+++ b/ar/.local/bin/mounter
@@ -49,6 +49,16 @@ mountedphones="$(grep "simple-mtpfs" /etc/mtab)"
echo "$phone"
done)"
+iphones="$(ideviceinfo | grep -E "^DeviceName" | sed "s/DeviceName: //;s/^/🍎/")"
+mountediphones="$(grep "ifuse" /etc/mtab)"
+[ -n "$mountediphones" ] && iphones="$(for iphone in $iphones; do
+ for mounted in $mountediphones; do
+ esciphone="$(escape "$iphone")"
+ [[ "$mounted" =~ $esciphone ]] && break 1
+ done && continue 1
+ echo "$iphone"
+done)"
+
# Check for drives.
lsblkoutput="$(sudo lsblk -rpo "uuid,name,type,size,label,mountpoint,fstype")"
# Get all LUKS drives
@@ -114,6 +124,7 @@ done)"
# Add all to one variable. If no mountable drives found, exit.
alldrives="$(echo "$phones
+$iphones
$unopenedluks
$normalparts
$smbs" | sed "/^$/d;s/ *$//")"
@@ -161,9 +172,16 @@ case "$chosen" in
getmount
number="${chosen%%:*}"
number="${chosen:1}" # This is a bashism.
- sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp"
+ sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp" 2>dev/null
notify-send "🤖 Android Mounted." "Android device mounted to $mp."
;;
+🍎*)
+ getmount
+ number="${chosen%%:*}"
+ number="${chosen:1}" # This is a bashism.
+ sudo -A ifuse "$mp" 2>dev/null
+ notify-send "🍎 iPhone Mounted." "$chosen mounted to $mp."
+ ;;
📡*)
chosen="${chosen##* }"
path="${chosen##*/}"