herbstluftwm: panel: fix volume compatibility

This commit is contained in:
Thomas Preisner 2016-12-13 16:24:02 +01:00
parent 6ad09824a9
commit 43281e078d

View file

@ -110,7 +110,7 @@ function battery() {
# VOLUME
function volume() {
vol=$(amixer get Master | grep "%" | head -n1 | awk -F"[][]" '{if($6~"off"){print "0%";} else {print $2;}}' | tr -d '%')
vol=$(amixer get Master | grep "%" | head -n1 | awk -F"[][]" '{if($4~"off" || $6~"off"){print "0%";} else {print $2;}}' | tr -d '%')
echo -n "^ca(1, amixer -q set Master 5%- && herbstclient emit_hook update)"
echo -n "^ca(2, amixer -q set Master toggle && herbstclient emit_hook update)"
echo -n "^ca(3, amixer -q set Master 5%+ && herbstclient emit_hook update)"