Get screen blank (Fn-F3) work on debian
July 26th, 2007It’s should be simple to get special key of thinkpad like Fn-F3 work on debian, and if you don’t know, you can see here.
I am using ibm-acpi, and everything goes well, except Fn+F3. I found there is a bug on debian package result in Fn+F3(close lcd) failed. The /etc/acpi/screenblank.sh which was called by ibm-acpi called getXuser from /usr/share/acpi-support/powerfunc, and this script assumed that you boot with gdm/kdm/xdm, so it using something like:
user=`finger| grep -m1 “:$displaynum “ | awk ‘{print $1}’`
to find your current user name. But if you boot from init 2 as me, that’s failed. Finger won’t show “:0″ or some other thing on your line, so getXuser will fail.
I fix this issue with add these lines in getXuser function:
if [ x“$user” = x“” ]; then
user=`finger| grep -m1 “*tty” | awk ‘{print $1}’`
fi
Though it not very precise, it works.


