diff --git a/programs/xmonad/xmobar/scripts/get_volume.sh b/programs/xmonad/xmobar/scripts/get_volume.sh index 5673405..50540bd 100755 --- a/programs/xmonad/xmobar/scripts/get_volume.sh +++ b/programs/xmonad/xmobar/scripts/get_volume.sh @@ -1,3 +1,9 @@ #!/bin/bash -echo $(amixer -D pulse sget Master | egrep -o "[0-9]+%" | head -n 1) +res=$(amixer -D pulse sget Master) +enabled=$(echo $res | egrep -o "\[on\]" | wc -l) +if [[ $enabled == "0" ]]; then + echo "off" +else + echo $(echo $res | egrep -o "[0-9]+%" | head -n 1) +fi exit 0