diff --git a/config/herbstluftwm/panel.sh b/config/herbstluftwm/panel.sh index 58ea0bc..b8d91ff 100755 --- a/config/herbstluftwm/panel.sh +++ b/config/herbstluftwm/panel.sh @@ -109,7 +109,7 @@ function battery() { # VOLUME function volume() { - vol=$(amixer get Master | awk -F"[][]" '/dB/ {if($6~"off"){print "0%";} else {print $2;}}' | tr -d '%') + vol=$(amixer get Master | grep "%" | head -n1 | awk -F"[][]" '{if($6~"off"){print "0%";} else {print $2;}}' | tr -d '%') if [[ $vol -le 0 ]]; then echo -n $(icon volume_off grey) $(echo $vol | dzen2-gdbar -nonl) else