[Debian-eeepc-devel] Temporarily disabling lid-close-suspend

Artur R. Czechowski arturcz at hell.pl
Tue Sep 16 22:13:28 UTC 2008

On Tue, Sep 16, 2008 at 10:44:42PM +0100, Phil Endecott wrote:
> # 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 like the idea.
> I think that the main case to worry about here is where you close and 
> then open before the suspend has actually happened.
Why? You close the lid, suspend is started, then you open the lid and
event is simply ignored.

> 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.
It would be nice to have this feature too. But wait...

> Is there a good way to detect that shutdown 
> is in progress?
I have seen it somewhere! /etc/acpi/actions/suspend.sh:

if (runlevel | grep -q [06]) || (pidof '/sbin/shutdown' > /dev/null); then
    exit 0

So, suspend.sh itself checks if it could safely suspend machine.


More information about the Debian-eeepc-devel mailing list