summaryrefslogtreecommitdiff
path: root/.old/umnt
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-04-17 10:46:59 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-04-17 10:46:59 -0500
commit35a2dd3734f1d31060fe28837cf0e1d947c8d6f4 (patch)
tree5fcb17f0849b520417ac0f29b94879f3e359ef43 /.old/umnt
parent3d3d79a57fb6d0a5728e0070475f05d1699f0818 (diff)
downloadscripts-35a2dd3734f1d31060fe28837cf0e1d947c8d6f4.tar.xz
scripts-35a2dd3734f1d31060fe28837cf0e1d947c8d6f4.zip
reorganize all scripts
Diffstat (limited to '.old/umnt')
-rwxr-xr-x.old/umnt8
1 files changed, 8 insertions, 0 deletions
diff --git a/.old/umnt b/.old/umnt
new file mode 100755
index 0000000..8191047
--- /dev/null
+++ b/.old/umnt
@@ -0,0 +1,8 @@
+#!/bin/sh
+exclude='\/efi$|\/boot$|\/home$|tbhdd$|\/$'
+if mountedpartition=`lsblk --noheadings --paths --raw | awk "/part .+/ && !/$exclude/ "'{ print $1, "(on", $7 ")" }' | dmenu -p "Unmount Device... "`
+then
+ doas umount -A "`echo $mountedpartition | sed 's/ .*//'`" \
+ && notify-send --urgency low "Device Successfully Unmounted" "Partition \"$mountedpartition\" successfully unmounted" --time 120000 \
+ || notify-send --urgency low "Error Unmounting Device" "Could not unmount partition \"$mountedpartition\""
+fi