diff options
Diffstat (limited to 'scripts/.local/bin/sb-volume')
| -rwxr-xr-x | scripts/.local/bin/sb-volume | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/.local/bin/sb-volume b/scripts/.local/bin/sb-volume index d9387b1..d1bda63 100755 --- a/scripts/.local/bin/sb-volume +++ b/scripts/.local/bin/sb-volume @@ -8,8 +8,16 @@ else vol="$(pamixer --get-volume)" fi +if ! command -v pamixer ;then + vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + case "$vol" in + *MUTED*) vol="MUT" ;; + *) vol=$(echo "100*$(echo "$vol" | cut -d' ' -f2)/1" | bc) ;; + esac +fi + # for slstatus printf "%s" "$vol" > /tmp/volume # for dwmblocks -printf "%3d" $vol +printf "%3d" "$vol" |
