Skip to content

Instantly share code, notes, and snippets.

@drwahl
Created December 20, 2019 17:35
Show Gist options
  • Save drwahl/6c54892390ee957c0ed83ea7e0ed7162 to your computer and use it in GitHub Desktop.
Save drwahl/6c54892390ee957c0ed83ea7e0ed7162 to your computer and use it in GitHub Desktop.
#!/bin/bash -xe
allSinks=$(pactl list short sinks | grep -v 'echo-cancel' | awk '{print $1}')
currentSink=$(pactl list short sink-inputs | tail -1 | awk '{print $2}')
newSink=$(echo $allSinks | tr " " "\n"| grep -v $currentSink)
pactl list short sink-inputs|while read stream; do
streamId=$(echo $stream|cut '-d ' -f1)
echo "moving stream $streamId"
pactl move-sink-input "$streamId" "$newSink"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment