aboutsummaryrefslogtreecommitdiff
path: root/dmenu-unmount
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2022-05-15 12:02:59 +0200
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2022-05-15 12:02:59 +0200
commit115ff9a06870d51702918cd926199e2271bf4f92 (patch)
tree4c2abf616b9eec3ba485f49bcefaf0a98882fa33 /dmenu-unmount
parent5ca3ebbf7c3cef6db6b8270af4fcf0be087c29c1 (diff)
downloadscripts-115ff9a06870d51702918cd926199e2271bf4f92.tar.gz
scripts-115ff9a06870d51702918cd926199e2271bf4f92.zip
Added option to specify alternative menu. Some general cleanup.
Diffstat (limited to 'dmenu-unmount')
-rwxr-xr-xdmenu-unmount18
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
6menu=${MENU:-dmenu} 8menu=dmenu
7writeout=herbe # Change this to whatever you want, e.g. echo or notify-send 9writeout=herbe
10
11while getopts "m:w:" opt; do
12 case "$opt" in
13 m)
14 menu="$OPTARG"
15 ;;
16 w)
17 writeout="$OPTARG"
18 ;;
19 esac
20done
21shift `expr $OPTIND - 1`
8 22
9listdev=$(grep "media" /proc/mounts | sed 's/\/media.*\///g' | \ 23listdev=$(grep "media" /proc/mounts | sed 's/\/media.*\///g' | \
10 awk '{print $1" ("$2")"}') 24 awk '{print $1" ("$2")"}')

Generated with cgit - Back to sebastiano.tronto.net