diff options
| author | Sam Nystrom <sam@samnystrom.dev> | 2026-01-12 17:34:16 -0500 |
|---|---|---|
| committer | Sam Nystrom <sam@samnystrom.dev> | 2026-01-12 17:34:16 -0500 |
| commit | 23b11c67aa806462f7dcac464c05a190f7dd3d52 (patch) | |
| tree | 8c4a2111b862156768c9d8edf2d2cf81eebf7ec3 | |
| parent | 30a5b19a7d97ff86ed88f6b722e1b2108b510191 (diff) | |
add monitor-volume script
| -rwxr-xr-x | bin/monitor-volume | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/monitor-volume b/bin/monitor-volume new file mode 100755 index 0000000..cbbb69d --- /dev/null +++ b/bin/monitor-volume @@ -0,0 +1,17 @@ +#!/bin/sh + +pw-dump --monitor | jq -r --unbuffered ' + .[] + | select( + .type? == "PipeWire:Interface:Node" + and (.info?."change-mask"? | any(. == "params")) + and .info?.props."media.class" == "Audio/Sink" + and .info?.params.Props != null + ) + | .info.params.Props + | .[] + | select(.channelVolumes != null) + | .channelVolumes[0] +' | while read -r v; do + printf '%.0f\n' "$(printf 'e(l(%f)/3)*100\n' "$v" | bc -l 2>/dev/null)" 2>/dev/null || true +done |
