Skip to content

Instantly share code, notes, and snippets.

@thenriquedb
Created August 11, 2021 13:38
Show Gist options
  • Save thenriquedb/3ed11b8c036f60a319f6dcc84750d016 to your computer and use it in GitHub Desktop.
Save thenriquedb/3ed11b8c036f60a319f6dcc84750d016 to your computer and use it in GitHub Desktop.
# https://unix.stackexchange.com/questions/62818/how-can-i-switch-between-different-audio-output-hardware-using-the-shell
CURRENT_PROFILE=$(pacmd list-cards | grep "active profile" | cut -d ' ' -f 3-)
if [ "$CURRENT_PROFILE" = "<output:hdmi-stereo>" ]; then
pacmd set-card-profile 0 "output:analog-stereo+input:analog-stereo"
else
pacmd set-card-profile 0 "output:hdmi-stereo"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment