annotate bin/movesinks @ 2144:0bc66003fa47

copy from DefinitelyTyped
author drewp@bigasterisk.com
date Wed, 17 May 2023 18:53:10 -0700
parents 440d116ba5df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
732
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
1 #!/bin/bash
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
2
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
3 # from http://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback/113322#113322
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
4
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
5 echo "Setting default sink to: $1";
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
6 pacmd set-default-sink $1
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
7 pacmd list-sink-inputs | grep index | while read line
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
8 do
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
9 echo "Moving input: ";
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
10 echo $line | cut -f2 -d' ';
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
11 echo "to sink: $1";
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
12 pacmd move-sink-input `echo $line | cut -f2 -d' '` $1
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
13
440d116ba5df asco: add switcher to pick the pulseaudio sink
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
14 done