[ltp] ibm-acpi and some scripts

Michael Perry linux-thinkpad@linux-thinkpad.org
Mon, 07 Mar 2005 16:33:57 -0800


Alejandro Bonilla wrote:
> OK, I looked at kernel 2.6.10 and has this cool ibm-acpi bla bla bla...
> 
> Nice, I know you all have talked about this already, now. Someone has 
> some extremely cool scripts so that I could add to my debian box to be 
> able to use those nice buttons? And also a way that I could run my own 
> script now that I created a little excecutable in /sbin/ to make the PC 
> suspend.
> 
> Someone had the awesome idea to add support for the Fn+F5 to be able to 
> use the radio of the IPW2200 driver?
> 
> I would love to have this baby almost feature ready. (FingerPrint reader 
> support is missing)
> 
> 
> Thank you all.
> 
> - Alejandro

Alejandro-

I wrote a few scripts here.  One does Fn-F4 suspends and there is a 
howto on this stuff in the archives as well.  Here is my Fn-F4 script 
which makes my T23 suspend after enabling ibm-acpi's hotkeys feature.  I 
also have a script which will suspend a T23 on lid close events which I 
won't bore you with.  Each script is a two parter actually.  You have a 
handler which captures an acpi event and then a shell script that gets 
executed.  Here are mine:

/etc/acpi/events/fn-f4
------------------------
event=ibm/hotkey HKEY 00000080 00001004
action=/etc/acpi/suspend.sh

/etc/acpi/suspend.sh
----------------------
#!/bin/sh
echo mem > /sys/power/state

Now the nice thing about the suspend.sh script is that one can add 
things to it.  Like I need to add back my command line tool to stop the 
linuxant driver so I add something before the echo command like 
"dldrstop" which will stop the card gracefully.  Then I can restart it 
by modprobe'ing the driver again when it starts back up.  I had issues 
before with usb and did almost the same thing to stop and start usb. 
After that it was pcmcia which seemed harder since the laptop would not 
suspend with a pcmcia anything card in the slot.  A patch from 
acpi.sf.net fixed this problem for me.

Hope this helps the kewlness :)

-- 
Michael Perry | do or do not. There is no try. -Master Yoda
mperry@lnxpowered.org | http://www.lnxpowered.org