osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

detect laptop open/close from within Python?


> No idea if it'll work on your system, but on my laptop, there's a
> pseudo-file /proc/acpi/button/lid/LID0/state that has whether the lid
> is open or closed.

Thanks, I do have that. Now to figure out when it changes state...
Unfortunately, the timestamp on the file seems to update continuously,
not just on state changes. Maybe /proc/acpi/wakeup will be of some
use.

Skip