Update 27-02-09: After upgrading to Jaunty Jackalope (kernel 2.6.28) the multimedia keys are now mapped correctly and can be assigned to shortcuts in Xfwm.

I have recently switched my primary desktop environment from Openbox to XFCE and suddenly found that the volume keys on my T61 didn’t work like they used to (in both GNOME and in Openbox (running gnome-settings-daemon)) they just worked. In XFCE, not so much – even
though I had at some point configured xmodmap to map the keys.

Apparently this has something to do with the ACPI interface (both changes in the kernel and the way Lenovo implements ACPI calls in the BIOS).

The solution was to use xbindkeys instead – it’s not part if the default Ubuntu installation so it needs to be installed

$ sudo apt-get install xbindkeys

I created the file $HOME/.xbindkeysrc like this:

#Volume+
"amixer set Master 2dB-"
    m:0x0 + c:174
        NoSymbol

#Volume-
"amixer set Master 2dB+"
    m:0x0 + c:176
    NoSymbol

#Toggle mute
"amixer sset toggle Master"
    m:0x0 + c:160
    NoSymbol

Update 10-10-2008:

I can’t remember when but a couple of weeks amixer in Intreped changed parameters so I needed to adjust $HOME/.xbindkeysrc accordingly.

#Volume+
"amixer sset Master 5%-"
    m:0x0 + c:174
        NoSymbol

#Volume-
"amixer sset Master 5%+"
    m:0x0 + c:176
    NoSymbol

#Toggle mute
"amixer sset Master toggle"
    m:0x0 + c:160
    NoSymbol

Remember to add /usr/bin/xbindskeys to XCFE’s autostarted programs.