Skip to content

Instantly share code, notes, and snippets.

Justin Justinzobel

Block or report user

Report or block Justinzobel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Justinzobel / gist:e40f0cbfee1b2454f28b54f61d0d3506
Created Jul 19, 2019
How to switch audio output from a terminal on Linux
View gist:e40f0cbfee1b2454f28b54f61d0d3506
Assumes you're using PulseAudio (fairly safe bet).
Find audio devices:
$ pactl list sinks | grep "Name: "
Name: alsa_output.pci-0000_01_00.1.hdmi-stereo
Name: alsa_output.usb-Corsair_Components__Inc._Corsair_Vengeance_1500-00.analog-stereo
Name: alsa_output.pci-0000_00_1f.3.analog-stereo
Copy the name of the sink you want into the variable devicename below and save as a bash script.
This can now be used with a hot-key to switch audio on the fly without opening anything.
You can’t perform that action at this time.