Deal with not-available sinks on audio switcher

Closes #1603
Co-authored-by: @elpritchos
This commit is contained in:
David Heinemeier Hansson
2025-09-14 19:37:35 +02:00
parent f8ff57e2af
commit c16766c8b1

View File

@@ -2,7 +2,7 @@
focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')"
sinks=$(pactl -f json list sinks | jq '[.[] | select([.ports[]? | .availability == "available"] | any)]')
sinks=$(pactl -f json list sinks | jq '[.[] | select((.ports | length == 0) or ([.ports[]? | .availability != "not available"] | any))]')
sinks_count=$(echo "$sinks" | jq '. | length')
if [ "$sinks_count" -eq 0 ]; then