ThinkPad Hotkeys

From openSUSE

(Redirected from ThinkPadHotkeys)

Contents

Getting Thinkpad Hotkeys and Power Management to work

There are two things broken in SuSE 10.3 that need to be fixed to make thinkpad hotkeys and hotkey driven power management to work.

Hotkey Setup

The out-of-the-box hotkey stuff doesn't work right because it doesn't detect properly that you're at the console. The root of the problem is /usr/lib/powersave/wttyHx. This program incorrectly identifies the console user as root all of the time. (Note: This seems to be fixed in 11.0) Here's a replacement I put in /usr/lib/powersave/getConsoleUser: You will need the ConsoleKit package installed for this to work.

#!/bin/bash

eval `/usr/bin/ck-list-sessions | grep -v '^Session' | sed -e 's/ = /=/g' | sed -e 's/-/_/g'`

name=`perl -e "\\$n=(getpwuid($uid))[0];print \\$n;"`

disp=`echo $x11_display_device | sed -e "s|/dev/tty||"`
echo $disp $name $x11_display 4

Next, you need to change /usr/lib/hotkey-setup to use this program rather than wttyHx, editing /usr/lib/hotkey-setup/thinkpad_hotkey_handler. Near the top, make your file look like this:

#WTTYHX=/usr/lib/powersave/wttyhx
WTTYHX=/usr/lib/powersave/getConsoleUser

function DEBUG(){
.
.
.

Now, you can go to lenovo's web site and download the linux packages that provide a simple UI for wireless control and a few other things, and they'll actually work. I used l79a23us.rpm and l79p12us-2.6.16-21-smp.rpm. The battery info kernel module doesn't work, but much of the other features do.

DBUS Bugaboos

You're not out of the woods yet! Some of the dbus config files don't allow the console user to do anything because there's a logic error in them. In particular, /etc/dbus-1/powersave.conf and hal.conf both suffer from the same oversight. The XML stanza that defines policy for "default" MUST BE AFTER ANY STANZA DEFINING POLICY FOR THE "at_console" USER. Apparently the FIRST MATCH WINS. Simply edit the file to rearrange the stanzas, and when acpid talks to DBUS, DBUS will actually do what you ask.

/etc/suspend.conf

Finally, edit /etc/suspend.conf to set your "resume device" to be your swap device explicitly.