From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LhZ3k-0004pw-Lx for garchives@archives.gentoo.org; Thu, 12 Mar 2009 00:46:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9F8F9E0444; Thu, 12 Mar 2009 00:46:03 +0000 (UTC) Received: from mail.fraggod.net (unknown [91.191.238.58]) by pigeon.gentoo.org (Postfix) with ESMTP id 6503FE0444 for ; Thu, 12 Mar 2009 00:46:03 +0000 (UTC) Received: from coercion (coercion.core [IPv6:2001:470:1f0b:11de::13]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.fraggod.net (Postfix) with ESMTPSA id 2FAB2102C1A for ; Thu, 12 Mar 2009 05:46:02 +0500 (YEKT) Date: Thu, 12 Mar 2009 05:42:50 +0500 From: Mike Kazantsev To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Bash and ACPI issue - laptop lid Message-ID: <20090312054250.25aca3d3@coercion> In-Reply-To: <49B83E34.6070108@gmail.com> References: <49B83E34.6070108@gmail.com> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i686-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/BP8O6N2MNM+fU9E8V=WGXrB"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Archives-Salt: 79858555-ad67-46f4-90e7-0304cb7deded X-Archives-Hash: 17af821c3fd7b08765b034655725fb6b --Sig_/BP8O6N2MNM+fU9E8V=WGXrB Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 11 Mar 2009 18:41:56 -0400 Saphirus Sage wrote: > 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? This one seem to be working for me: #!/bin/sh if grep closed /proc/acpi/button/lid/LID0/state &>/dev/null then echo "Lid closed, suspending..." else echo "Lid is open, doing nothing" fi Then, you can just put it to, say, crontab, with a line like this: */5 * * * * /path/to/script.sh ...which'll make it run every five minutes, so the laptop will be suspended within five mins of closing the lid, which should also prevent accidental closing events. Of course, you should put your actions to the aforementioned script, if you want it to do something useful, instead of just experimental echo. --=20 Mike Kazantsev // fraggod.net --Sig_/BP8O6N2MNM+fU9E8V=WGXrB Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (GNU/Linux) iEYEARECAAYFAkm4Wo8ACgkQASbOZpzyXnE7aACdHmKVwjA69bMYPHVny8uNs4er RwEAn2x/bvngje1tiDvApF5Op77AJZ7R =gW8A -----END PGP SIGNATURE----- --Sig_/BP8O6N2MNM+fU9E8V=WGXrB--