From 115ff9a06870d51702918cd926199e2271bf4f92 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 15 May 2022 12:02:59 +0200 Subject: Added option to specify alternative menu. Some general cleanup. --- dmenu-unmount | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'dmenu-unmount') diff --git a/dmenu-unmount b/dmenu-unmount index 2c59ec4..57f0c41 100755 --- a/dmenu-unmount +++ b/dmenu-unmount @@ -1,10 +1,24 @@ #!/bin/sh # Prompts selection for mounted devices and unmounts the selected one +# Usage: dmenu-unmount [-m menu] [-w writer] +# Example: dmenu-unmount -m slmenu -w echo # Requires: udevil, dmenu (or similar), notify-send or similar (optional) -menu=${MENU:-dmenu} -writeout=herbe # Change this to whatever you want, e.g. echo or notify-send +menu=dmenu +writeout=herbe + +while getopts "m:w:" opt; do + case "$opt" in + m) + menu="$OPTARG" + ;; + w) + writeout="$OPTARG" + ;; + esac +done +shift `expr $OPTIND - 1` listdev=$(grep "media" /proc/mounts | sed 's/\/media.*\///g' | \ awk '{print $1" ("$2")"}') -- cgit v1.3