Friday, June 25, 2010

Laptop lid state

Laptop lid state is given by,

cat /proc/acpi/button/lid/state

To test if it works try,

sleep 2 ; cat /proc/acpi/button/lid/state

Now, close the lid and open after 2 secs.

It will tell that the lid was closed.

No comments:

Print chess board in command line

The following bash one-liner will print a chess board in a terminal (the script works for the shells bash and ksh only) for (( i = 1; i ...