diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2018-04-10 17:43:40 -0700 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2018-04-10 17:43:40 -0700 |
| commit | 2dc5e822334a2d0fb6860f9b55f91b2e328a2ad6 (patch) | |
| tree | 63d2255587f79f7fbc0182d87b7a9c8d699bfebd /.scripts/dmenuumount | |
| parent | e75e7b680f8f5cce5a89dadc4c5514a8eee74811 (diff) | |
| download | eibhear-2dc5e822334a2d0fb6860f9b55f91b2e328a2ad6.tar.gz eibhear-2dc5e822334a2d0fb6860f9b55f91b2e328a2ad6.tar.zst eibhear-2dc5e822334a2d0fb6860f9b55f91b2e328a2ad6.zip | |
dmenu recording, mounting and umounted added
Diffstat (limited to '.scripts/dmenuumount')
| -rwxr-xr-x | .scripts/dmenuumount | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.scripts/dmenuumount b/.scripts/dmenuumount new file mode 100755 index 0000000..5a26677 --- /dev/null +++ b/.scripts/dmenuumount @@ -0,0 +1,14 @@ +#!/bin/sh + +# A dmenu prompt to unmount drives. +# Provides you with mounted partitions, select one to unmount. + +# Drives mounted at /, /boot and /home will not be options to unmount. +# This can be changed by modifying $exclusionregex. + +exclusionregex="\(/boot\|/home\|/\)$" +drives=$(lsblk -lp | grep "t /" | grep -v "$exclusionregex" | awk '{print $1, "(" $4 ")", "on", $7}') +[[ "$drives" = "" ]] && exit +chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') +[[ "$chosen" = "" ]] && exit +sudo umount $chosen |
