X-Git-Url: https://git.danieliu.xyz/?p=dotfiles.git;a=blobdiff_plain;f=Scripts%2Fstatusbar%2Fblocks_vol;fp=Scripts%2Fstatusbar%2Fblocks_vol;h=868c1bf4adf85be9a079ad53f611b27ce8cac20e;hp=846d638380dc84ea4ac98d5049bf43c7cf70eb70;hb=68c67b541445ec5c32c4660243d906b4c5479115;hpb=6b58ea8b8d9799698f147e5677b4b6e6d47a7e9d diff --git a/Scripts/statusbar/blocks_vol b/Scripts/statusbar/blocks_vol index 846d638..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 + +volume="$(pulsemixer --get-volume | awk '{ print $1 }')" icon="" -[ ${volume%\%} -gt "0" ] && icon="" -[ ${volume%\%} -gt "50" ] && icon="" -[ ${volume%\%} -gt "75" ] && icon="" -echo -e "$icon $volume" +[ "$volume" -gt "0" ] && icon="" +[ "$volume" -gt "50" ] && icon="" +[ "$volume" -gt "75" ] && icon="" + +[ "$(pulsemixer --get-mute)" = 1 ] && icon="ﱝ" && volume="XX" +printf "$icon $volume%%"