My keyboard has dedicated keys to change the audio volume and to mute/unmute audio. How can I make these work in XFCE?

up vote 25 down vote accepted
  1. Right click a panel -> Panel submenu -> Add New Items...
  2. Add an instance of PulseAudio Plugin
  3. Right click the icon that just appeared in your panel and click "Properties". Make sure "Enable keyboard shortcuts for volume control" is enabled.

You may have to install the PulseAudio Plugin first. In Debian and Debian-based distributions, the package is called xfce4-pulseaudio-plugin.

  • 2
    For future searchers: this solved my problem in a Thinkpad X1 when upgrading from Debian jessie to Debian stretch – bnewbold Aug 6 '17 at 6:04
  • 1
    nice. Worked for my setup: Ubuntu 18 + xfce4 – Zeta.Investigator Aug 21 at 9:56
  • I dont want an item in my panel just for working hotkeys. Pretty strange solution – Blauhirn yesterday

1.-Configuration

2.-Keyboard

3.-Application shortcuts

4.-Add

amixer set Master 5%+ --> (Volume Up)

amixer set Master 5%- --> (Volume Down)

amixer set Master toggle --> (Mute/Unmute)

enter image description here

  • Adding the mute/unmute toggle only mutes the audio. When I press the same key combo, the audio is not unmuted. On Ubuntu 18.04 + xfce4. The volume up and down commands works well. – Akshay Gaur Sep 11 at 14:55

Please notice, that both answers are correct, but each depend on different packages for the sound management. Erik here uses pulseaudio while Samuel Loza's answer implies, that alsamixer is used.

xfce4-pulseaudio-plugin

  1. Right click a panel -> Panel submenu -> Add New Items...
  2. Add an instance of PulseAudio Plugin
  3. Right click the icon that just appeared in your panel and click "Properties". Make sure "Enable keyboard shortcuts for volume control" is enabled. -> See: Sound settings -> Audio mixer will tell you what package you use. If pulseadio is used the field should tell pavucontrol.
  4. Open the configuration for your keyboard shortcuts and add the following commands:
    pactl -- set-sink-volume 0 +10% # raise volume by each 10% (more than 100% possible, might distort the sound)
    pactl -- set-sink-volume 0 -10% # reduce volume by each 10%
    pactl -- set-sink-mute 0 toggle # mute/unmutes audio

alsamixer (compare Samuel's answer)

  1. Check if alsamixer is working as your sound management.
  2. Go see the configuration for keyboard shortcuts and edit:
    amixer set Master 10%+ # raise volume by each 10 %
    amixer set Master 10%- # reduce volume by each 10 %
    amixer set Master toggle # mute/unmute audio

The first solution works for me on Debian stretch, I had problems with the sound after the upgrade from jessie. The settings work while using headphones as well. One can adapt the amount of increase/decrease in % freely.

Duplicated questions:
How to increase or decrease volume in Xfce with keyboard shortcuts? (English, NA)
Muting and unmuting sound with mutebutton (English, Debian jessie)

Further links:
https://wiki.debian.org/Sound (English, Debian)
https://bugs.launchpad.net/xfce4-volumed/+bug/883485 (English, Debian+Ubuntu)
https://askubuntu.com/questions/652890/shortcuts-volume-specific-output (English, Ubuntu 15.04)
Lower or increase pulseaudio volume on all outputs (English, Debian sid)
https://mysudo.wordpress.com/2015/03/27/unmute-pulseaudio-sound-in-xfce-debian-jessie/ (German, Debian jessie)
https://ubuntuforums.org/showthread.php?t=2342661 (English, Ubuntu)

  • Alsamixer should always work, even when using Pulseaudio – Erik Sep 27 at 13:10

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.