diff options
Diffstat (limited to '')
| -rwxr-xr-x | dmenu-unmount | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/dmenu-unmount b/dmenu-unmount index 2c59ec4..57f0c41 100755 --- a/dmenu-unmount +++ b/dmenu-unmount | |||
| @@ -1,10 +1,24 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # Prompts selection for mounted devices and unmounts the selected one | 3 | # Prompts selection for mounted devices and unmounts the selected one |
| 4 | # Usage: dmenu-unmount [-m menu] [-w writer] | ||
| 5 | # Example: dmenu-unmount -m slmenu -w echo | ||
| 4 | # Requires: udevil, dmenu (or similar), notify-send or similar (optional) | 6 | # Requires: udevil, dmenu (or similar), notify-send or similar (optional) |
| 5 | 7 | ||
| 6 | menu=${MENU:-dmenu} | 8 | menu=dmenu |
| 7 | writeout=herbe # Change this to whatever you want, e.g. echo or notify-send | 9 | writeout=herbe |
| 10 | |||
| 11 | while getopts "m:w:" opt; do | ||
| 12 | case "$opt" in | ||
| 13 | m) | ||
| 14 | menu="$OPTARG" | ||
| 15 | ;; | ||
| 16 | w) | ||
| 17 | writeout="$OPTARG" | ||
| 18 | ;; | ||
| 19 | esac | ||
| 20 | done | ||
| 21 | shift `expr $OPTIND - 1` | ||
| 8 | 22 | ||
| 9 | listdev=$(grep "media" /proc/mounts | sed 's/\/media.*\///g' | \ | 23 | listdev=$(grep "media" /proc/mounts | sed 's/\/media.*\///g' | \ |
| 10 | awk '{print $1" ("$2")"}') | 24 | awk '{print $1" ("$2")"}') |
