Jeremy Gardais 2019-06-19 22:37:03 +02:00
commit a14ef35708
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 23 additions and 0 deletions

23
move.pulseaudio.sink Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# `pacmd set-default-sink` doesn't want to work on my computer,
# so this small script will move all playback stream to the choosen sink.
# Thanks to mreithub - https://unix.stackexchange.com/a/67398
if [ -z "$1" ]; then
echo "Usage: $0 <sinkId/sinkName>" >&2
echo "Valid sinks:" >&2
pactl list short sinks >&2
exit 1
fi
newSink="$1"
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
exit 0