Keyboard shortcuts to adjust audio settings

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
jgn2112
Level 1
Level 1
Posts: 31
Joined: Sun Feb 03, 2019 11:51 am

Keyboard shortcuts to adjust audio settings

Post by jgn2112 »

I've been running 19.3 for about a month, all updates current. But one peculiarity I've noticed is that somehow the f10-f12 keys on my laptop's keyboard don't adjust volume like the icon on each key would indicate. The keyboard icons are:
f10: mute
f11: volume -
f12: volume +
I know how to create general keyboard shortcuts, but how do I restore these keys so that they do what they're supposed to do?

Currently, in order for them to govern audio volume, I have to hit the "fn" key along with f10, f11, or f12. Any way I can create a standard shortcut so I don't have to also hit the "fn" key?

Thank you.

User avatar
MrEen
Level 19
Level 19
Posts: 9765
Joined: Mon Jun 12, 2017 8:39 pm

Re: Keyboard shortcuts to adjust audio settings

Post by MrEen »

What you describe is how it's supposed to work. An example, in many apps, F11 without the function key toggles Full Screen mode.

You might be able to reverse the need of the Fn key by pressing Fn+Esc, but there might be unintended consequences doing this. This is not an option on every system that I know of, but it might be on yours, especially if it's a Dell product. Pressing Fn+Esc again, puts it back to normal mode.

jgn2112
Level 1
Level 1
Posts: 31
Joined: Sun Feb 03, 2019 11:51 am

Re: Keyboard shortcuts to adjust audio settings

Post by jgn2112 »

Thank you for the reply. My laptop is an ASUS and I don't think I want to risk something by trying to reverse the fn switch. Is there a way I can reassign f10-f12 to increase, decrease, and mute volume?
If it's going to really mess with things, I think I'll just leave it be.

User avatar
MrEen
Level 19
Level 19
Posts: 9765
Joined: Mon Jun 12, 2017 8:39 pm

Re: Keyboard shortcuts to adjust audio settings

Post by MrEen »

Well, you can create your own keyboard shortcuts. How that's done depends on the DE I believe. On Xfce, it's Menu > Settings > Keyboard > Application Shortcuts tab.

For the commands used, you need to know the card number, but if it's card 0 these are the commands:

Code: Select all

amixer set Master toggle #this toggles mute
amixer set Master 5%+ #this increases volume approximately 5%
amixer set Master 5%- #this decreases volume approximately 5%
If the card is card 1 or card 2, change the commands thusly: amixer -c1 set ... amixer -c2 set... You get the idea. Find the card number with aplay -l in the terminal. Here's mine:

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 2: Generic [HD-Audio Generic], device 0: ALC221 Analog [ALC221 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
Yours probably won't be so massive. My built-in card is card 2. You'll probably want the one that has an ALC number like my card 2 shows.

One tip. If you want volume up and down to also act when the volume was muted, use this instead:

Code: Select all

amixer set Master toggle 
amixer set Master 5%+ unmute
amixer set Master 5%- unmute
Just remember, you'll lose the fullscreen functionality of F11 doing this. That might actually be a good thing for some. Some people have accidentally hit that, then couldn't figure out how to get to other windows.

Post Reply

Return to “Newbie Questions”