My keyboard has dedicated keys to change the audio volume and to mute/unmute audio. How can I make these work in XFCE?
5 Answers
- Right click a panel -> Panel submenu -> Add New Items...
- Add an instance of PulseAudio Plugin
- 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
.
1.-Configuration
2.-Keyboard
3.-Application shortcuts
4.-Add
amixer -D pulse set Master 5%+ --> (Volume Up)
amixer -D pulse set Master 5%- --> (Volume Down)
amixer -D pulse set Master toggle --> (Mute/Unmute)
Update:
The parameter -D pulse
was added to the command so it would work with current versions of xfce4 using pulseaudio for sound.
-
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. Sep 11, 2018 at 14:55
-
I've used Enable keyboard shortcuts for volume control = Off, combined with amixer set Master 20%- command on Mute hotkey, to disable Mute hotkey and instead of Mute do a rapid volume reduce. Its more convenient than Mute :)– idonnieFeb 2, 2019 at 10:06
-
1Ubuntu 18.04 / xfce4 I had to use
amixer -D pulse set Master 15%-
without the "-D pulse" the volume did not change. Jul 10, 2019 at 9:53 -
1Use "amixer -D pulse set Master 1+ toggle" to make also unmute working– PanoptikNov 19, 2019 at 9:25
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
- Right click a panel -> Panel submenu -> Add New Items...
- Add an instance of PulseAudio Plugin
- 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 tellpavucontrol
. - Open the configuration for your keyboard shortcuts and add the following commands:
pactl -- set-sink-volume @DEFAULT_SINK@ +10%
# raise volume by each 10% (more than 100% possible, might distort the sound)
pactl set-sink-volume @DEFAULT_SINK@ -10%
# reduce volume by each 10%
pactl set-sink-mute @DEFAULT_SINK@ toggle
# mute/unmutes audio
alsamixer
(compare Samuel's answer)
- Check if alsamixer is working as your sound management.
- 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)
-
1
-
1pactl -- set-sink-volume @DEFAULT_SINK@ +10% with @DEFAULT_SINK@ instead of 0 as mentioned in the answer below helped me. I just add this as a comment so that other people find the remark immediately.– exchangeApr 28, 2020 at 11:40
Trying to use pactl -- set-sink-volume 0 +10%
did not work for me.
Using @DEFAULT_SINK@
instead of 0
as the sink worked for me.
Example:
pactl -- set-sink-volume @DEFAULT_SINK@ +10%
-
1
Deleting the files in ~/.config/pulse then running the following in the terminal should fix it:
pulseaudio -k
You may need to restart your sound playing apps after that, and if pulseaudio doesn't restart on its own, this will restart it:
pulseaudio --start
Okay. At the bottom of the window click
on Add. In the window that open for the command enter this:
amixer -D pulse sset Master 3%+ unmute
Now click on Ok, then it'll ask you to press the key(s) you want to assign to that command. Just press your volume up button and it should be done.
You can then repeat the process using this for the volume decrease button:
amixer -D pulse sset Master 3%- unmute
If you have a mute button as well, repeat one more time using this:
amixer -D pulse sset Master toggle
In case your permissions got messed up, this terminal command will fix them (I don't know any other way to do this, sorry!):
sudo chown -Rc $USER:$USER $HOME