Global volume control with esekeyd

Something that has been bugging me ever since I first tried Linux (Ubuntu when it used to be… not shitty) is the fact, that the media button of my Laptop, especially the volume control, never seemed to work in fullscreen applications. And since I recently started playing Battle for Wesnoth again, I decided to tackle the problem once and for all.

A fairly simple way to fix it is esekeyd a deamon that listens to keyboard events and then executes whatever command you wish. It is available in the arch repositories, so first install it using pacman:

sudo pacman -S esekeyd

After you installed it you need to edit the config file /etc/esekeyd.conf which holds entries like the following:

#VOLUMEDOWN:amixer set Master 5%- &
#VOLUMEUP:amixer set Master 5%+ &
#MUTE:amixer set Master toggle &

If you simply want your volume control to work, uncommenting these lines should suffice. However If you are not sure what the buttons are called or if you simply want to check if esekeyd receives the keystrokes correctly, you can use the handy keytest tool, which is also part of the esekeyd package:

sudo /usr/bin/keytest

The tool will print the names of the pressed keys to the screen.

After you are done with the config file, start the daemon (and add it to your DAEMONS list in /etc/rc.conf if you want it to automatically start during boot):

sudo /etc/rc.d/esekeyd start

When I first tried this nothing seemed to work and it turned out that for some reason I didn’t have amixer installed, so make sure you have the package alsa-utils on your computer.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.