herbstluftwm: panel: volume: ensure compatibility

This commit is contained in:
Thomas Preisner 2016-12-13 00:02:39 +01:00
parent 7bdd82b737
commit ab737ad7ce

View file

@ -109,7 +109,7 @@ function battery() {
# VOLUME # VOLUME
function 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 if [[ $vol -le 0 ]]; then
echo -n $(icon volume_off grey) $(echo $vol | dzen2-gdbar -nonl) echo -n $(icon volume_off grey) $(echo $vol | dzen2-gdbar -nonl)
else else