added cycle_pactl.sh

(cherry picked from commit 113c31566b)
This commit is contained in:
2025-07-11 06:12:32 +02:00
parent 2a52a22ff3
commit 3440a583a0
2 changed files with 17 additions and 54 deletions

17
bin/cycle_pactl.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -e
default_sink=$(pactl info | grep "Default Sink:" | cut '-d ' -f3)
sinks=$(pactl list short sinks | cut -f2)
# for wrap-around
sinks="$sinks
$sinks"
next_sink=$(echo "$sinks" | awk "/$default_sink/{getline x;print x;exit;}")
pactl set-default-sink "$next_sink"
pactl list short sink-inputs | \
cut -f1 | \
xargs -I{} pactl move-sink-input {} "$next_sink"