Skip to content

Instantly share code, notes, and snippets.

@vaughany
Created April 6, 2023 13:31
Show Gist options
  • Save vaughany/bfcbc5238629f7e450b4ae9180877fe1 to your computer and use it in GitHub Desktop.
Save vaughany/bfcbc5238629f7e450b4ae9180877fe1 to your computer and use it in GitHub Desktop.
Changing the sound output on my Lenovo P15s from bash (https://askubuntu.com/a/14083/80418)
#!/bin/bash
# Put in /usr/local/bin/hdmi1 and chmod +x it. Run with 'hdmi1'.
pacmd set-default-sink "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink"
#!/bin/bash
# Put in /usr/local/bin/hdmi2 and chmod +x it. Run with 'hdmi2'.
pacmd set-default-sink "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_4__sink"
#!/bin/bash
# Put in /usr/local/bin/headphones and chmod +x it. Run with 'headphones'.
pacmd set-default-sink "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment