[ltp] a few long questions with potentially short answers

André Wyrwa linux-thinkpad@linux-thinkpad.org
Fri, 13 Mar 2009 11:20:58 +0100


--=-wbCeYlXLjFKLZl+wz/Ou
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2009-03-10 at 14:57 +0100, Jens Rutschmann wrote:
> Tino Keitel wrote on 10.03.2009 12:59:
> > I'm open for suggestions how to achieve this in a better way.
>=20
> I don't know if it is better, but I'm doing it using acpid.
>=20
> Add the following to /etc/acpi/default.sh (or whatever the acpi event han=
dler=20
> script of your distribution is). This is working on my T61 using Gentoo.
>=20
> Add the toggle() function at at the top of the file:
>=20
> toggle() {
> 	exec 3< $1
> 	read <&3 oldValue
>=20
> 	case "${oldValue}" in
> 		0)
> 			echo 1 > $1
> 		;;
> 		1)
> 			echo 0 > $1
> 		;;
> 	esac
> }

I like the way you read the value. I'll use good old acpid then, but
will rather use a separate script and event file.

Andre.


--=-wbCeYlXLjFKLZl+wz/Ou
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEABECAAYFAkm6M4oACgkQEOp8fsnyxsTBswCfdKl2T69CCVGF2ApNXVeCNS3j
2C8AoI5dyDnSEseNtExYKxghORbZd23b
=wtju
-----END PGP SIGNATURE-----

--=-wbCeYlXLjFKLZl+wz/Ou--