summaryrefslogtreecommitdiff
path: root/scripts/.local/bin/sb-volume
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.local/bin/sb-volume')
-rwxr-xr-xscripts/.local/bin/sb-volume10
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"