I have two audio output channels:
- internal speaker
- headset
I would like to switch between both via a key on the keyboard.
There are some special keys above the number block which I don't use. For example there is a key which opens a calculator.
How could I get this done?
22 Answers
I created a script which changes the audio-sink in a round-robin fashion:
You can map this script to a key with your desktop environment.
As said, on Settings → Keyboard shortcuts you can create a custom one to a command similar to:
bash -c '[[ $(pacmd list-cards | grep "active profile" | cut -d " " -f 3-) = "<output:hdmi-stereo-extra1+input:analog-stereo>" ]] && pacmd set-card-profile 0 "output:analog-stereo+input:analog-stereo" || pacmd set-card-profile 0 "output:hdmi-stereo-extra1+input:analog-stereo"'Of course you should change the card profiles accordingly of those between you want to toggle.