diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-09-07 20:36:27 +0000 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-09-07 20:36:27 +0000 |
| commit | 3bf5e6834dbc88471f62d5405a9113fb304ca6b6 (patch) | |
| tree | 3bd293ad5f48dc2102d0843496a8cda2fb9cabc7 /polybar | |
| parent | 430418d198a055599031fe2693975c608d461260 (diff) | |
| download | dots-3bf5e6834dbc88471f62d5405a9113fb304ca6b6.tar.gz | |
polybar: Add linux volume script for pipewire
Diffstat (limited to 'polybar')
| -rwxr-xr-x | polybar/Linux-vol.sh | 14 |
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 |