summaryrefslogtreecommitdiff
path: root/keyboard/umnt
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2021-09-11 00:36:13 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2021-09-11 00:36:13 -0500
commit0a9053c2902adab8b94eaacdb15390441143078c (patch)
tree1f1a38272dbd554cde8cdec263187112b9c6a7e8 /keyboard/umnt
downloadscripts-0a9053c2902adab8b94eaacdb15390441143078c.tar.xz
scripts-0a9053c2902adab8b94eaacdb15390441143078c.zip
redid repo cus of fucking chromium rip old commit messages
Diffstat (limited to 'keyboard/umnt')
-rwxr-xr-xkeyboard/umnt8
1 files changed, 8 insertions, 0 deletions
diff --git a/keyboard/umnt b/keyboard/umnt
new file mode 100755
index 0000000..d43297d
--- /dev/null
+++ b/keyboard/umnt
@@ -0,0 +1,8 @@
+#!/bin/sh
+exclude='\/boot\/|\/home$|tbhdd$|\/$'
+if mountedpartition=`lsblk --noheadings --paths --raw | awk "/part .+/ && !/$exclude/ "'{ print $1, "(on", $7 ")" }' | dmenu -p "Unmount Device... "`
+then
+ doas umount "`echo $mountedpartition | sed 's/ .*//'`" \
+ && notify-send --urgency low "Device Successfully Unmounted" "Partition \"$mountedpartition\" successfully unmounted" \
+ || notify-send --urgency low "Error Unmounting Device" "Could not unmount partition \"$mountedpartition\""
+fi