diff options
| author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-16 21:37:40 +0200 | 
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-16 21:37:40 +0200 | 
| commit | d23ebcfb61c5c2db65f406a9c1f03c7df308d81b (patch) | |
| tree | 75305a7b1c65e071960ff808c95b135fe863cea5 /bin/guiscripts | |
| parent | 50734b37c14c84ea8d2d43c4ade4c23f175993c5 (diff) | |
maded dmvol MENUCMD sensitive
Diffstat (limited to 'bin/guiscripts')
| -rwxr-xr-x | bin/guiscripts/dmvol | 15 | 
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/guiscripts/dmvol b/bin/guiscripts/dmvol index 8909de7..0f36e18 100755 --- a/bin/guiscripts/dmvol +++ b/bin/guiscripts/dmvol @@ -1,12 +1,23 @@  #!/bin/sh + +if [ "$MENUCMD" = "tofi" ] +then +	menucmd="tofi --width 5% --height 10% --prompt-text"  +elif [ "$MENUCMD" = "dmenu" ] +then +	menucmd="dmenu -g 2 -l 1 -p" +else +	menucmd="fzf --prompt" +fi +  while true  do   	volume="$(mpc volume | awk '{print $2}' | cut -f1 -d'%')"  	choice="$(echo "plus\nmin" | -		dmenu -g 2 -l 1 -p "$volume" | +		$menucmd "$volume" |  		sed 's/plus/+/;s/min/-/')"  	test -z "$choice" && break -	nb="$(dmenu -g 2 -l 1 -p "$volume$choice" < /dev/null)" +	nb="$($menucmd "$volume$choice" < /dev/null)"  	test -z "$nb" && break  	mpc volume "$choice$nb"  done  | 
