summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpolybar/Linux-vol.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/polybar/Linux-vol.sh b/polybar/Linux-vol.sh
new file mode 100755
index 0000000..3bf54e9
--- /dev/null
+++ b/polybar/Linux-vol.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+PW_AUDIO_OUT=57
+
+while true; do
+ LEVEL=$(wpctl get-volume $PW_AUDIO_OUT 2> /dev/null | cut -d' ' -f2,3)
+ MUTED=$(echo "$LEVEL" | grep -q '[MUTED]'; echo $?)
+ if [[ $MUTED -eq 0 ]]; then
+ echo 'muted'
+ else
+ echo "$(bc <<< ${LEVEL/./})%"
+ fi
+ sleep 1
+done