Linux Blog

thinkpad_handler ACPI Script for Lenovo T61 hotkeys

Filed under: Shell Script Sundays — at 2:54 pm on Sunday, January 18, 2009

Lenovo T61 Thinkpad_Handler ACPI hotkey

This weeks shell scripting article showcases the modifications I have made to the thinkpad_handler script that normally resides in /usr/lib/acpid on an OpenSuse distribution. For any one not using a Lenovo T61 this may or may not be useful, however anyone interested in shell scripting can take a look at the file and see the simplicity of shell scripts that are used in production environments.

Here is my modified thinkpad_handler script

One of the reasons I chose to post this was because an OpenSuse upgrade broke my brightness keys support, so I figured it would be another good place to back it up while providing a reference. My modifications are very minimal at the moment, I still have a lot of work to do.

Here are my minor modifications:

Line 102 to add support for suspendon Fn+F4

Line 127 to eject /dev/cdrom on Fn+F9

I used to have a special script for Fn+F8 which enabled me to toggle support for the touchpad and track point mouse. Until I find that script I’ll endure excruciating mental anguish every time I accidentally hit the touchpad. I’ll have to make an update to this script once I change all of the other hotkeys for OpenSuse on the Lenovo T61 or other similar Lenovo notebook computer. I should also probably upgrade to OpenSuse 11.1 and see if that makes a difference in the keyboard shortcuts.

Until next week, happy scripting!