commit 44c367ccf8d7b3d1032fad50e96c01ecec3c8626
parent d95719a0cd0ff2101cde22eeab3ba7a55fcd7713
Author: regexghost <dev@regexghost.com>
Date: Mon, 20 Jul 2026 21:39:21 +0100
update to qmount.sh, fat32/vfat support and messages on no drives
Diffstat:
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/terminal-scripts/qmount.sh b/terminal-scripts/qmount.sh
@@ -7,16 +7,25 @@ root_device="$(/usr/bin/lsblk -l -n --output NAME,MOUNTPOINTS | grep '/$' | sed
mount () {
unmounted="$(/usr/bin/lsblk -l -n --output NAME,FSTYPE,SIZE,MOUNTPOINTS,TYPE | grep "part" | grep -v "/" | grep -v "$root_device" | tr -s " " | cut -d " " -f 1-3)"
- chosen_partition="$(echo "$unmounted" | fzf | cut -d " " -f 1)"
+ [ "$unmounted" = "" ] && echo "No drives to mount" && exit
+
+ chosen="$(echo "$unmounted" | fzf)"
+ chosen_partition="$(echo "$chosen" | cut -d " " -f 1)"
+ chosen_fstype="$(echo "$chosen" | cut -d " " -f 2)"
[ "$chosen_partition" = "" ] && exit
chosen_mount_point="$(echo "$mount_points" | fzf | sed "s|~|$HOME|")"
[ "$chosen_mount_point" = "" ] && exit
-
- sudo mount "/dev/${chosen_partition}" "$chosen_mount_point" && notify-send "Mounted Successfully" || notify-send "Mount Failed"
+ args=""
+ if [ "$chosen_fstype" = "vfat" ]; then
+ args="-o rw,users,umask=000"
+ fi
+ sudo mount $args "/dev/${chosen_partition}" "$chosen_mount_point" && notify-send "Mounted Successfully" || notify-send "Mount Failed"
}
unmount () {
mounted="$(/usr/bin/lsblk -l -n --output NAME,MOUNTPOINTS | grep "/" | grep -v "$root_device" | tr -s " ")"
+ [ "$unmounted" = "" ] && echo "No drives to unmount" && exit
+
chosen_path="$(echo "$mounted" | fzf | cut -d " " -f 2-)"
[ "$chosen_path" = "" ] && exit
sudo umount "$chosen_path" && notify-send "Unmounted Successfully" || notify-send "Unmounting Failed"