Update audio switch script to filter available sinks (#1555)

Filter audio sinks to include only available ports.
This commit is contained in:
elpritchos authored and GitHub committed 2025-09-10 08:51:28 +02:00
1 parent 80767e8686
commit 627b5f4ead
1 file changed
+1 -1
+1 -1
View File
@@ -2,7 +2,7 @@
focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')" focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')"
sinks=$(pactl -f json list sinks) sinks=$(pactl -f json list sinks | jq '[.[] | select([.ports[]? | .availability == "available"] | any)]')
sinks_count=$(echo "$sinks" | jq '. | length') sinks_count=$(echo "$sinks" | jq '. | length')
if [ "$sinks_count" -eq 0 ]; then if [ "$sinks_count" -eq 0 ]; then