ESE Key Daemon

ESE key daemon is another way to use your keyboard's multimedia keys, that allows you to run commands even if some app grabs keyboard, where others multimedia binders would fail (xbindkeys, kmilo, etc.).
Furthermore, it works in a non-X environment. (e.g. from the console)

Simply delegating ESEkeyd to user-daemon

However, needing root privileges, ESEkeyd can be difficult to use in multi-user setups. This tip add an extra user-daemon dependency to allow each user to have his/her configuration.

ESEkeyd will send UDP messages containing key pressed to any user-daemon listening on the UDP port 8730.

Writing configuration

First, find your multimedia keys with :
learnkeys /etc/esekeyd.conf /dev/input/event0

Then, automatically process your configuration file with :
sed -i 's/^\([A-Z].*\):.*/\1:ek-send \1/' /etc/esekeyd.conf

Which will turn this sample config :

# this is a comment


into this new configuration :
# this is a comment


Put this to /usr/local/bin/ek-send (or a "ek-send" file anywhere in your PATH)
echo $* | socat STDIO UDP-SENDTO:localhost:8730

And "chmod +x" that file.

User configuration

Now, any user can run his/her own daemon listening on UDP port 8730.
The use of UDP allows the daemon to be run by any user at anytime.

Here is an example daemon :


socat STDIO UDP-RECV:8730 <&- | while read line; do
    case $line in
        # insert a command to pump the volume up
               echo unhandled key : $line ;;

That daemon can be run at the beginning of your session and quit at the end of it.