Skip to content

Instantly share code, notes, and snippets.

@donthorp
Created October 30, 2021 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donthorp/91eddc3af0fc3e43074aa252f6d9ff73 to your computer and use it in GitHub Desktop.
Save donthorp/91eddc3af0fc3e43074aa252f6d9ff73 to your computer and use it in GitHub Desktop.
Move Audio to HDMI on Pop OS
#! /usr/bin/env bash
# pactl set-default-sink \$(pactl list short sinks | grep hdmi-stereo | cut -f 1)
cat /etc/pulse/default.pa | grep "load-module module-stream-restore restore_device=false" > /dev/null
if [ $? -ne 0 ]
then
echo
echo "You may need to edit /etc/pulse/default.pa and add change:"
echo " 'load-module module-stream-restore' to"
echo " 'load-module module-stream-restore restore_device=false'"
echo
echo " https://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback/72076#72076"
echo
fi
CHAN=$(pactl list short sinks | grep hdmi-stereo | cut -f 1)
pactl list short sinks | cut -f 1,2,5
echo "HDMI Channel: $CHAN"
pactl suspend-sink $CHAN false
pactl set-default-sink $CHAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment