ThinkFinger

Backlight

To make backlight buttons turn the backlight turn up and down you can do the following.

First edit /etc/modprobe.conf to make the thinkpad_acpi module load with some special options:

/etc/modprobe.conf:

options thinkpad_acpi brightness_enable=1 hotkey=enable,0xffffff

Restart acpid and grab the events they key combinations make with acpi_listen:

/etc/rc.d/acpid restart
acpi_listen

The backlight down button on my machine creates:

ibm/hotkey HKEY 00000080 00001010

backlight up button creates:

ibm/hotkey HKEY 00000080 00001011

Edit /etc/acpi/handler.sh:

ibm/hotkey)
case "$2" in
HKEY)
case "$4" in
00001010)
# backlight down
# Check current state
typeset -i state=`cat /sys/class/backlight/thinkpad_screen/brightness`
# Subtract one from the current state and echo it to the file
down=$((state-=1))
echo "$down" > /sys/class/backlight/thinkpad_screen/brightness
;;
00001011)
# backlight up
# Check current state
typeset -i state=`cat /sys/class/backlight/thinkpad_screen/brightness`
# Add one to the current state and echo it to the file
state+=1
echo "$state" > /sys/class/backlight/thinkpad_screen/brightness
;;