[Debian-eeepc-devel] Temporarily disabling lid-close-suspend
Phil Endecott
spam_from_debian_eee at chezphil.org
Tue Sep 16 21:44:42 UTC 2008
Damyan Ivanov wrote:
> -=| Phil Endecott, Mon, Sep 15, 2008 at 11:01:50AM +0100 |=-
>> button/lid LID 00000080 00000006 <=== lid close
>> button/lid LID 00000080 00000007 <=== lid open
>> button/lid LID 00000080 00000008 <=== lid close
>> button/lid LID 00000080 00000009 <=== lid open
>> button/lid LID 00000080 0000000a <=== lid close
>> button/lid LID 00000080 0000000b <=== lid open
>>
>> Hmm. Does anyone know how I should interpret this?
>
> The second number is incremented with each event like a counter.
Indeed. And it seems that open events aren't counted when the Eee is
suspended at the time, so you can't assume that odd/even implies
open/close. It seems that you can, however, look in
/proc/acpi/button/lid/LID/state to get the current state. So I've
added this to my lid.sh:
# Ignore lid-open events
case `cat /proc/acpi/button/lid/LID/state` in
open) exit 0 ;;
close) ;;
*) # exit with a warning message maybe?
esac
I think that the main case to worry about here is where you close and
then open before the suspend has actually happened.
I would also like to do something about closing the lid after you've
initiated a shutdown. I think that there should be no suspend so that
the shutdown can complete. Is there a good way to detect that shutdown
is in progress?
Cheers, Phil.
More information about the Debian-eeepc-devel
mailing list