summaryrefslogtreecommitdiff
path: root/bin/guiscripts/dmvol
diff options
context:
space:
mode:
Diffstat (limited to 'bin/guiscripts/dmvol')
-rwxr-xr-xbin/guiscripts/dmvol14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/guiscripts/dmvol b/bin/guiscripts/dmvol
index ccbf46b..a73e128 100755
--- a/bin/guiscripts/dmvol
+++ b/bin/guiscripts/dmvol
@@ -1,10 +1,12 @@
#!/bin/sh
-volume=0
while true
do
- volume="$(dmenu -p "$(mpc volume)" < /dev/null)"
- test -z "$volume" && break
- mpc volume "$(echo -e "plus\nmin" |
- dmenu -g 2 -l 1 |
- sed 's/plus/+/;s/min/-/')$volume"
+ volume="$(mpc volume | awk '{print $2}' | cut -f1 -d'%')"
+ choice="$(echo -e "plus\nmin" |
+ dmenu -g 2 -l 1 -p "$volume" |
+ sed 's/plus/+/;s/min/-/')"
+ test -z "$choice" && break
+ nb="$(dmenu -g 2 -l 1 -p "$volume$choice" < /dev/null)"
+ test -z "$nb" && break
+ mpc volume "$choice$nb"
done