Glam Prestige Journal

Bright entertainment trends with youth appeal.

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?

2

2 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.

screenshot

See also.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy