public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Bash and ACPI issue - laptop lid
@ 2009-03-11 22:41 Saphirus Sage
  2009-03-12  0:42 ` Mike Kazantsev
  2009-03-12 12:13 ` Sebastian Günther
  0 siblings, 2 replies; 4+ messages in thread
From: Saphirus Sage @ 2009-03-11 22:41 UTC (permalink / raw
  To: gentoo-user

I've been trying to setup my laptop to enter ACPI S3 (suspend to ram)
when I close the lid. I currently have the scripts setup as such:
/etc/acpi/events/lid
    event=button[ /]lid.*
    action=/etc/acpi/actions/lid.sh
/etc/acpi/actions/lid.sh
    #!/bin/bash
    for i in $(cat /proc/acpi/button/lid/LID/state | grep -o closed); do
        if [ $i = "closed" ]; then
        /usr/sbin/pm-suspend
        fi
        if [ $i != "closed" ]; then
        sleep 5
        fi
    done
The issue I've run into is that this will cause my laptop to suspend to
the RAM upon any change in the lid state, irregardless of if it is open
or closed. I tried to be more specific by utilizing the suffix of the
event, but it's incremental, which is a bit beyond my abilities. Any
suggestions to make this suspend only when the lid is closed?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-12 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 22:41 [gentoo-user] Bash and ACPI issue - laptop lid Saphirus Sage
2009-03-12  0:42 ` Mike Kazantsev
2009-03-12  1:35   ` Saphirus Sage
2009-03-12 12:13 ` Sebastian Günther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox