feat: audio cast

This commit is contained in:
2026-06-09 14:39:32 +02:00
parent cf2108ad82
commit 5f6fbdc0ac
12 changed files with 241 additions and 16 deletions
+22
View File
@@ -0,0 +1,22 @@
set -eu
get_id() {
pw-dump | jq -r --arg name "$1" '
.[]
| select(.type == "PipeWire:Interface:Node")
| select(.info.props["node.name"] == $name)
| .id
'
}
ID_A=$(get_id "$SINK_A")
ID_B=$(get_id "$SINK_B")
CURRENT_ID=$(wpctl inspect @DEFAULT_AUDIO_SINK@ |
awk '$1 == "id" { gsub(",", "", $2); print $2 }')
if [ "$CURRENT_ID" = "$ID_A" ]; then
wpctl set-default "$ID_B"
else
wpctl set-default "$ID_A"
fi