From 40370656d49498889b1def4cb7474670b5c2fee0 Mon Sep 17 00:00:00 2001 From: ivan-boikov Date: Tue, 20 Aug 2024 01:55:14 +0200 Subject: sb-volume without pamixer --- scripts/.local/bin/sb-volume | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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" -- cgit v1.2.3