diff --git a/modules.sh b/modules.sh index 64e0271..1f2d4fd 100755 --- a/modules.sh +++ b/modules.sh @@ -23,11 +23,11 @@ module_user() { } module_vol_pa() { - export bar="${bar}${1}$(echo "`pamixer --get-volume`%")${2}" + export bar="${bar}${1}$(if pamixer --sink 0 --get-mute | grep -q 'false'; then echo "`pamixer --sink 0 --get-volume`%"; else echo "OFF"; fi)${2}" } module_vol_alsa() { - export bar="${bar}${1}$(echo "`amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/"`%")${2}" #Thanks speedie for the command + export bar="${bar}${1}$(if amixer sget Master | grep -q 'on'; then echo "`amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/"`%"; else echo "OFF"; fi)${2}" #Thanks speedie for the command } module_mic_pa() {