toggle radeontool [was Re: [ltp] ACPI on T40]

Alexander Naumann linux-thinkpad@linux-thinkpad.org
Thu, 02 Sep 2004 08:19:15 +0200


--=-INohNa9+7AajmL7jIlQp
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Use the ibm_acpi tool (you can find it here on the mailing list) to connect the Fn+F3 to this script.
I hope this will work for you.
Alex

On Thu, 2004-09-02 at 00:49, Brian P. Flaherty wrote:
> Alexander Naumann <alexandernaumann@gmx.de> writes:
> 
> > Screen blanking works with the radeontool.
> 
> Did you tie radeontool to Fn-F3 (or some other key combination)?  On
> my X31 under APM, Fn-F3 toggled screen blanking.  I'd like to retain
> this under ACPI.
> 
> I tried ibm_acpi last night and most of it looked like it worked.  My
> current plan is to have a shell script linked to the Fn-F3 event.  On
> a key press, the script looks for a file in a tmp directory
> somewhere (e.g., /var/tmp or /var/run).  If it doesn't find the file,
> it turns the light off and creates the file.  If it finds the file, it
> removes it and turns the light back on.
> 
> I think this will work, but it seems like a sloppy way to do it.  I am
> sure there are better ways to do it and I hope someone here will tell
> me.
> 
> Thanks for your time.
> 
> Brian

--=-INohNa9+7AajmL7jIlQp
Content-Disposition: attachment; filename=lid.sh
Content-Type: application/x-shellscript; name=lid.sh
Content-Transfer-Encoding: 7bit

#!/bin/bash

RADEONTOOL='/usr/local/sbin/radeontool'

status=`$RADEONTOOL light|awk '/The radeon backlight looks / {print $5}'`;

if [[ "$status" = "on" ]] ; then
	$RADEONTOOL light off
elif [[ "$status" = "off" ]] ; then
	$RADEONTOOL light on
fi
	

--=-INohNa9+7AajmL7jIlQp--