Special Buttons

The laptop has various special buttons to control the volume and CD playing. I haven't worried about getting the CD ones working, but I did want to get the volume buttons working; here's how to do it.

First, make sure you have the i8k code in your kernel. You could, perhaps, compile it as a module, but then you'd have to force it to always be loaded; I just compiled it into the kernel itself. You can check to see that it's installed by seeing if /proc/i8k exists.

Next, download the i8kutils package. Check to see if the Makefile is appropriate; for me, KERNEL_SOURCE should have been /usr/src/linux-2.4, but actually I doubt that would have mattered when compiling it (since I wasn't compiling the module from this package). Install it; make install will put the utilities in /usr/bin, so if you want them to go somewhere else, just install them by hand. Also, do cp *.1 /usr/share/man/man1.

The main program to use is i8kbuttons. It's a daemon that checks to see if the volume buttons are pressed, and runs arbitrary code in response to presses. To start it, I added the following line to /etc/rc.local:

/usr/local/bin/i8kbuttons -u "aumix -v +5" -d "aumix -v -5" -m "aumix -v 0" -r 100 &

(Note: the mute button is Fn-End.)

Like I said, I haven't worried too much about getting the other buttons working; they don't require i8kbuttons to support them, since they're regular keys. On my system, they're keycodes 129-132 (you can check that with xev); then you could use xmodmap to map them to keysyms (e.g. to function keys F13-F16, or something), and then map them to something (if you're using GNOME/Sawfish, look at Start Here/Preferences/Sawfish window manager/Shortcuts).


david carlton <carlton@math.stanford.edu>

Last modified: Mon Jul 8 17:42:34 PDT 2002