summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2025-09-07 20:36:27 +0000
committerChristoph Schlosser <christoph@linux.com>2025-09-07 20:36:27 +0000
commit3bf5e6834dbc88471f62d5405a9113fb304ca6b6 (patch)
tree3bd293ad5f48dc2102d0843496a8cda2fb9cabc7
parent430418d198a055599031fe2693975c608d461260 (diff)
downloaddots-3bf5e6834dbc88471f62d5405a9113fb304ca6b6.tar.gz
polybar: Add linux volume script for pipewire
-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