[SOLVED] Getting keyboard volume buttons to work in LXDE
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yes - both of those work in lowering and raising the volume. So something is getting lost in applying the working command [e.g. pamixer --sink 0 -i 5] to the keys.
Sorry to resurrect this, but this function has stopped working for a while now, I can no longer use the keyboard buttons to adjust the audio volume. I have no idea what the issue could be. I wonder if it has anything to do with new packages that have been upgraded or installed, but since the file
.config/openbox/lxde-rc.xml
is unchanged I have no idea what such packages could be or why they could do so. Any suggestions would be most welcome.
if you issue the same commands to which you have associated keys for in a terminal, do they have effect?
Hmm, good idea. I'm just getting the response
Code:
Connection error
Wonder what could be causing that. I thought it could be because I enabled alsaequal/dmix, but I removed the code from .asoundrc and logged out/in, and I'm still getting the paerror.
EDIT: I did the following re another thread, this has definitely affected my link to PA
Quote:
1) Comment these lines in asound.conf:
Code:
pcm.default pulse
ctl.default pulse
2) Append these lines to /etc/pulse/default.pa:
Code:
load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop
3) Keep this line in /etc/pulse/client.conf:
Code:
autospawn = yes
So I think I see what's going on here. I wonder if there's a way to directly raise/lower the volume via ALSA.
EDIT 2 -found it
Code:
amixer set Master 5%+
I imagine replacing the old code with this would work
EDIT 3 -and it does, thank you.
Seems on this system ALSA is the way for now rather than PA.
Last edited by Lysander666; 03-28-2018 at 01:05 PM.
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 tell pavucontrol.
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
Config for keyboard shortcuts in Xfce = settings > keyboard > shortcuts
Notice the difference between pavu and alsa in the answer which accounts for my volume stopping working initally in LXDE since I have disabled access to Pulse in my other Slack install. Hopefully someone will find this useful.
Last edited by Lysander666; 07-19-2018 at 03:11 PM.
Reason: added Xfce
I confirm it works on my desktop Devuan ASCII.
Many thanks @Lysander666, you really helped me!
I listen radio broadcasting, live news etc via players that have their own shortcuts. But while other programs were on the screen, I had to use the mouse to conrtol the volume from the panel volume-icon.
With:
Code:
amixer set Master 5%+
amixer set Master 5%-
amixer set Master toggle
in 3 keyboard shortcuts (XFCE>Settings>Keyboard>Shortcuts>+Add) thinks are much easier, thanks again!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.