I want to set a unique hotkey to be able to alternate the system sound between analog and HDMI outputs. How can I do this?
This behavior could be observed in play
shortcut (from org.gnome.settings-daemon.plugins.media-keys
) that play and pause the media alternatively.
I could find answered here that the command to set the sound-output is
pactl set-card-profile 0 output:[card-profile]
Well, reading the topics that DK Bose and vanadium suggested and having done some more research to learning about bash script and Linux PulseAudio sound server, I came up with one solution:
We need to save the following script in a file (preferably in
/usr/local/bin/
, as explained here), mark it as executable (by runchmod +x
over it) and then assigned it to a keyboard shortcut (optionally as explained here).