X-Git-Url: https://git.danieliu.xyz/?p=dotfiles.git;a=blobdiff_plain;f=Scripts%2Fstatusbar%2Fblocks_vol;h=868c1bf4adf85be9a079ad53f611b27ce8cac20e;hp=4bb4ab93da53bf161bc994178ebea31b1d313904;hb=68c67b541445ec5c32c4660243d906b4c5479115;hpb=14d61ce32ff2cdca6af3accb75840abcaaf558ef diff --git a/Scripts/statusbar/blocks_vol b/Scripts/statusbar/blocks_vol index 4bb4ab9..868c1bf 100755 --- a/Scripts/statusbar/blocks_vol +++ b/Scripts/statusbar/blocks_vol @@ -1,10 +1,14 @@ #!/bin/sh -volume="$(amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }')" +# Audio status for pulseaudio with pulsemixer -icon="" -[ ${volume%\%} -gt "0" ] && icon="" -[ ${volume%\%} -gt "50" ] && icon="" -[ ${volume%\%} -gt "75" ] && icon="" -echo -e "$icon $volume" +volume="$(pulsemixer --get-volume | awk '{ print $1 }')" +icon="" +[ "$volume" -gt "0" ] && icon="" +[ "$volume" -gt "50" ] && icon="" +[ "$volume" -gt "75" ] && icon="" + +[ "$(pulsemixer --get-mute)" = 1 ] && icon="ﱝ" && volume="XX" + +printf "$icon $volume%%"