HARDWARE IBM ThinkPad Z61p / Xmodmap sample

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related

You need to compile some stuff to your kernel (or kernel modules) to get this working. I think the following will do:

CONFIG_THINKPAD_ACPI=y
CONFIG_ACPI_BUTTON=y

Once done and rebooted (or modprobed if you used modules instead), enable the keys (as root):

/bin/echo enable,0xffffffff > /proc/acpi/ibm/hotkey

Now you can use xmodmap to map the special keys.

File: ~/.Xmodmap
keycode 159 = XF86LaunchA
keycode 234 = F19
keycode 233 = F20
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 153 = XF86AudioNext
keycode 144 = XF86AudioPrev

Note: The first entry, 159/XF86LaunchA does not work out of the box, you may need TPB to get it working (further described bellow).

Instead of F19/F20 (good for custom commands) you can put XF86Back/XF86Forward (good for built-in commands in programs). Once saved, you can load the map:

xmodmap ~/.Xmodmap

[edit] ThinkVantage button

The 159/XF86LaunchA did not work for me so I followed the steps in ThinkWiki's guide and made a acpi script.

emerge -aq acpid

You'll need acpid to proceed. Now for the acpid event...

File: /etc/acpi/events/ThinkVantage
event=ibm/hotkey HKEY 00000080 00001018
action=/etc/acpi/thinkpad_thinkvantage.sh

And the script...

File: /etc/acpi/thinkpad_thinkvantage.sh
#!/bin/bash
# TODO: Do your stuff here, I couldn't get acpi_fakekey working with X but it still might be usefull.

[edit] See also

[edit] External links

Personal tools