From 9964120d55a1b956ae14939e2f115dc356e207a2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 2 Apr 2023 22:33:01 +0200 Subject: remade dmvol --- bin/guiscripts/dmvol | 14 ++++++++------ 1 file 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 -- cgit v1.2.3