summaryrefslogtreecommitdiff
path: root/old/mnt
diff options
context:
space:
mode:
Diffstat (limited to 'old/mnt')
-rwxr-xr-xold/mnt11
1 files changed, 11 insertions, 0 deletions
diff --git a/old/mnt b/old/mnt
new file mode 100755
index 0000000..7547912
--- /dev/null
+++ b/old/mnt
@@ -0,0 +1,11 @@
+#!/bin/sh
+# '/part\s*$\|rom\s*$/!d; s/\s*[^[:space:]]*\s*$/\)/; s/\s/ \(/' # More correct in my opinion, but slower
+if partition=`lsblk -npro "name,size,type,mountpoint" | sed '/part $\|rom $/!d; s/ [a-z]* $/\)/; s/ / \(/' | dmenu -p "Choose drive to mount: " | cut -d' ' -f1` \
+&& [ -n "$partition" ] \
+&& mountpoint=`ls -d /media/mnt/slot*/ | dmenu -p "Choose mountpoint: "` \
+&& [ -n "$mountpoint" ]
+then
+ doas mount "$partition" "$mountpoint"; user="$(whoami)"; ug="$(groups | cut -d' ' -f1)"; doas chown "$user":"$ug" "$mountpoint" \
+ && notify-send --urgency low "Device Successfully Mounted" "Successfully Mounted partition \"$partition\" to mountpoint \"$mountpoint\"" \
+ || notify-send --urgency low "Error Mounting Device" "Could not mount partition \"$partition\" to mountpoint \"$mountpoint\""
+fi