I have two audio outputs: one is a wireless headset, the other is my laptop's built-in 3.5mm jack. How do I switch between them via the terminal? Ultimately, I want to assign a keyboard shortcut to do the switch.
I have two audio outputs: one is a wireless headset, the other is my laptop's built-in 3.5mm jack. How do I switch between them via the terminal? Ultimately, I want to assign a keyboard shortcut to do the switch.
I built a script which does the switching. I call it using
xbindkeys
. I'm sure it could be improved, because I'm not very good with grep, and it's not ideal that the script works on the basis of numbers instead of names. The script is big because it takes a lot of effort to automate the process, but here are the essential parts: