Dell SK-8135
If you have used any of my previous blog posts to setup your DELL-SK-8135 keyboard on Linux please read through the following tutorial. I have streamlined the process a tad.
1. Identify the keyboard volume knob device.
The first step is to locate the device node for your keyboard’s volume knob. To get a list of possible devices, issue the following command.
# ls /dev/input/event* /dev/input/event0 /dev/input/event1 /dev/input/event2 /dev/input/event3 /dev/input/event4 /dev/input/event5 /dev/input/event6 /dev/input/event7
As you can see, my system has 8 event devices, 0-7. One of these is the keyboard’s volume knob. As root I will probe each one in turn. To do this, I use sudo to execute the command as root, I then cat data from the device and pipe it through xxd. Xxd will format the device’s output to resemble a hex editor. As event devices only “talk” when there is input, you will want to turn your volume knob after hitting enter for each command. If you don’t see any output from xxd, hit control+C to cancel the command and try the next device in your list…
# sudo cat /dev/input/event0 | xxd # sudo cat /dev/input/event1 | xxd # sudo cat /dev/input/event2 | xxd # sudo cat /dev/input/event3 | xxd # sudo cat /dev/input/event4 | xxd # sudo cat /dev/input/event5 | xxd 0000000: c4a7 a346 0000 0000 d5fb 0a00 0000 0000 ...F............ 0000010: 0300 2000 0100 0000 c4a7 a346 0000 0000 .. ........F.... 0000020: dbfb 0a00 0000 0000 0000 0000 0000 0000 ................ 0000030: c4a7 a346 0000 0000 daef 0c00 0000 0000 ...F............ 0000040: 0300 2000 0200 0000 c4a7 a346 0000 0000 .. ........F.... 0000050: e0ef 0c00 0000 0000 0000 0000 0000 0000 ................ 0000060: c5a7 a346 0000 0000 a489 0300 0000 0000 ...F............ 0000070: 0300 2000 ffff ffff c5a7 a346 0000 0000 .. ........F.... 0000080: aa89 0300 0000 0000 0000 0000 0000 0000 ................ 0000090: c5a7 a346 0000 0000 a77d 0500 0000 0000 ...F.....}...... 00000a0: 0300 2000 fdff ffff c5a7 a346 0000 0000 .. ........F.... 00000b0: ac7d 0500 0000 0000 0000 0000 0000 0000 .}.............. 00000c0: c5a7 a346 0000 0000 ad65 0900 0000 0000 ...F.....e...... 00000d0: 0300 2000 feff ffff c5a7 a346 0000 0000 .. ........F.... 00000e0: b465 0900 0000 0000 0000 0000 0000 0000 .e..............
So /dev/input/event5 is my volume knob. Now, I don’t want to have to be root in order to read from this device. As such, we will use udev to set the permissions on this device node.
2. Configuring udev.
To configure udev, we must first ask udev about our device.
# udevinfo -a -p /sys/class/input/event5
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/class/input/input5/event5':
KERNEL=="event5"
SUBSYSTEM=="input"
DRIVER==""
ATTR{dev}=="13:69"
...
This gives us some information about the attributes of this device which we can use to write some rules for udev to follow when handling it. As root I will create an empty file and put a rule into it.
# vi /etc/udev/rules.d/10_local.rules
SUBSYSTEM=="input", ATTR{dev}=="13:71", NAME="input/event5", OWNER="root", GROUP="audio", mode="0740"
Now, as root tell udev to apply this rule.
# udevtrigger # ls -lah /dev/input/event5 crwxr----- 1 root audio 13, 71 Jul 22 16:47 /dev/input/event5
We can see now that the audio group owns the device node, just as our rule defined. This means that you need to be part of the audio group to read from this device. Add yourself to the audio group if you are not already a member, use your username instead of mine (btimby).
# usermod -a -G audio btimby
Log out and log back in, verify that you are in the audio group.
# id uid=1000(btimby) gid=100(users) groups=7(lp),10(wheel),18(audio),19(cdrom),35(games),100(users),250(portage),418(vmware)
3. Volumed
Now that we have the device node under control, we can use volumed to manage our mixer in response to our turning the knob. I have a new version of this daemon which does not require a kernel patch located here. To download/compile it, use the following commands.
# wget http://ben.timby.com/pub/volumed-0.9.tar.gz # tar xzf volumed-0.9.tar.gz # cd volumed # make # sudo make install
I plan on integrating this feature into the lineakd package or providing a plugin. More to come on that, check back later.
After the volumed daemon is installed, you must ensure it runs either on bootup or when X starts. For me, I play music in X, so I have volumed in my .xinitrc. You can edit yours as follows.
# vi ~/.xinitrc volumed /dev/input/event5 &
Add the line above to this file. All lines except the last line (your window manager) should end with a &.
4. Lineakd
To install lineakd, use your distros package manager to install it. On Gentoo, this is portage.
# sudo emerge -av lineakd lineak-defaultplugin
This will install the lineak daemon as well as the default plugin, which provides cdrom eject and volume control macros. Once installed, you must configure lineakd and set it up to start with your system. Now you must configure lineakd, there is a good guide here. For those of you in a hurry, here is my configuration.
# cat /etc/lineak/lineakd.conf # LinEAK - Linux support for Easy Access and Internet Keyboards # Copyright (c) 2001,2002, 2003 Sheldon Lee Wen(Current Maintainer) # and Mark Smulders # http://lineak.sourceforge.net # # lineakd configuration file # # example key configuration: # play = "xmms --play-pause" # eject = EAK_EJECT # # Lineakd supports the following modifier keys: # control alt shift mod2 mod3 mod4 mod5 CdromDevice = /dev/cdrom Display_plugin = xosd Display_align = center Display_color = 0aff00 Display_font = -adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-* Display_hoffset = 0 Display_pos = middle Display_soffset = 1 Display_timeout = 3 Display_voffset = 50 KeyboardType = DELL-SK-8135 MixerDevice = /dev/mixer RAWCommands = Screensaver = conffilename = /root/.lineak/lineakd.conf keystate_capslock = keystate_numlock = keystate_scrolllock = WebBack = EAK_SENDKEYS(Alt_L+left-arrow) Menu = "galculator >& /dev/null" WebStop = EAK_SENDKEYS(Control_L+F4) Mail = "thunderbird >& /dev/null" WebFwd = EAK_SENDKEYS(Alt_L+right-arrow) WebHome = EAK_SENDKEYS(Alt_L+Home) MyComputer = "xscreensaver-command -lock" Music = "audacious >& /dev/null" [Toggle Mute] Mute = "amixer set Front toggle >& /dev/null && amixer set Center toggle >& /dev/null && amixer set Side toggle >& /dev/null && amixer set Surround toggle >& /dev/null && amixer set LFE toggle >& /dev/null" [Next] Next = "audacious -f >& /dev/null" [Play/Pause] Play|Pause = "audacious -t >& /dev/null" [Previous] Previous = "audacious -r >& /dev/null" WebRefresh = EAK_SENDKEYS(F5) [Stop] Stop = "audacious -s >& /dev/null"
Now for starting lineakd, since I only use the media keyboard in X I use my .xinitrc to start lineakd.
# vi ~/.xinitrc lineakd &







