From 23b11c67aa806462f7dcac464c05a190f7dd3d52 Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Mon, 12 Jan 2026 17:34:16 -0500 Subject: add monitor-volume script --- bin/monitor-volume | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/monitor-volume 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 -- cgit v1.2.3