Skip to content

Instantly share code, notes, and snippets.

@dlight
Created April 5, 2018 12:08
Show Gist options
  • Save dlight/194d403165a9ffe550ec724f91f0c7f1 to your computer and use it in GitHub Desktop.
Save dlight/194d403165a9ffe550ec724f91f0c7f1 to your computer and use it in GitHub Desktop.
#!/bin/sh
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 set-default-sink "$newSink"
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
#!/bin/sh
move-pulse alsa_output.pci-0000_00_03.0.hdmi-stereo
notify-send -t 100 hdmi
#!/bin/sh
move-pulse alsa_output.pci-0000_00_1b.0.analog-stereo
notify-send -t 100 laptop-audio
#!/bin/sh
move-pulse alsa_output.usb-C-Media_Electronics_Inc._Microsoft_LifeChat_LX-3000-00.analog-stereo
notify-send -t 100 ms-headphone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment