My install: Gentoo + Xorg + i3 + PulseAudio. acpi_listen gives correct output, like, VOLUP, VOLDOWN

But I can't figure out how to make these keys actually change the volume.

My laptop model is HP Pavilion 15-n059sr

Why the solution depends on the keyboard?

  • Kinda depends on the keyboard manufacturer and how they implemented them. What's the keyboard or laptop model number from the serial number plate underneath? Please find it then click on edit and hive us that very useful information by adding it to your original post. – K7AAY Dec 6 '18 at 21:37
  • 1
    also depends on the DE/WM in use, and how what gets mapped ... – tink Dec 6 '18 at 22:22
  • @tink i3 is only a WM, right? I think normally it's a DE mapping? – Sparhawk Dec 6 '18 at 22:25
  • Dunno what I3 is; but Fluxbox is a WM, and I have it mapped :D on my keyboard. – tink Dec 6 '18 at 22:58

I thought such functionality comes with X11 itself, but as it turns out it comes with xbindkeys, which is a X11-related program that is in category miscellaneous.

To get multimedia keys(volume, brightness) working, create ~/.xbindkeysrc. To get useful information(default file contents) on how the file is composed, call xbindkeys -d

# ~/.xbindkeysrc

# Decrease volume
"pactl set-sink-volume @DEFAULT_SINK@ -1000"

# Increase volume
"pactl set-sink-volume @DEFAULT_SINK@ +1000"

# Mute volume
"pactl set-sink-mute @DEFAULT_SINK@ toggle"

# Increase backlight
"xbacklight -inc 10"

# Decrease backlight
"xbacklight -dec 10"

And add xbindkeys to autostart. I added it to ~/.xinitrc

Keys like Play, Next are handled by your multimedia player.

Your Answer

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

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