summaryrefslogtreecommitdiff
path: root/.local/bin/mounter
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/mounter')
-rwxr-xr-x.local/bin/mounter12
1 files changed, 6 insertions, 6 deletions
diff --git a/.local/bin/mounter b/.local/bin/mounter
index 246680e..3972784 100755
--- a/.local/bin/mounter
+++ b/.local/bin/mounter
@@ -68,13 +68,13 @@ getmount(){
test -n "$mp"
if [ ! -d "$mp" ]; then
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
- [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || doas mkdir -p "$mp")
+ [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
fi
}
attemptmount(){
# Attempt to mount without a mountpoint, to see if drive is in fstab.
- doas mount "$chosen" || return 1
+ sudo -A mount "$chosen" || return 1
notify-send "💾Drive Mounted." "$chosen mounted."
exit
}
@@ -84,7 +84,7 @@ case "$chosen" in
chosen="${chosen%% *}"
chosen="${chosen:1}" # This is a bashism.
attemptmount || getmount
- doas mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
+ sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
;;
@@ -98,12 +98,12 @@ case "$chosen" in
done
# Decrypt in a terminal window
- ${TERMINAL:-st} -n floatterm -g 60x1 -e doas cryptsetup open "$chosen" "usb$num"
+ ${TERMINAL:-st} -n floatterm -g 60x1 -e sudo cryptsetup open "$chosen" "usb$num"
# Check if now decrypted.
test -b "/dev/mapper/usb$num"
attemptmount || getmount
- doas mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)"
+ sudo -A mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)"
notify-send "🔓Decrypted drive Mounted." "$chosen decrypted and mounted to $mp."
;;
@@ -112,7 +112,7 @@ case "$chosen" in
getmount
number="${chosen%%:*}"
number="${chosen:1}" # This is a bashism.
- doas 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"
notify-send "🤖 Android Mounted." "Android device mounted to $mp."
;;
esac