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 1Lhjn7-0004zZ-0o for garchives@archives.gentoo.org; Thu, 12 Mar 2009 12:13:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CD718E027F; Thu, 12 Mar 2009 12:13:34 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by pigeon.gentoo.org (Postfix) with ESMTP id 6DD8FE027F for ; Thu, 12 Mar 2009 12:13:34 +0000 (UTC) Received: from localhost ([92.50.83.196]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis) id 0ML21M-1Lhjn31dsp-0007yO; Thu, 12 Mar 2009 13:13:33 +0100 Date: Thu, 12 Mar 2009 13:13:32 +0100 From: Sebastian =?iso-8859-1?Q?G=FCnther?= To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Bash and ACPI issue - laptop lid Message-ID: <20090312121332.GB7039@marvin.heimnetz.local> References: <49B83E34.6070108@gmail.com> 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; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qlTNgmc+xy1dBmNv" Content-Disposition: inline In-Reply-To: <49B83E34.6070108@gmail.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Provags-ID: V01U2FsdGVkX1/0l3hOG4qJb3KDGlx8Zka6cEYAQHl9BpCN68Q vkMJJhojHEq/MagzJBVmj4X9FfxJ7/KKL2Aj7AJeHjzJ+FtlUr 2vGYhNaAB5pNQkDgopVOA== X-Archives-Salt: 41330067-7142-4978-8d5e-bec14341fd22 X-Archives-Hash: 8460dae490b9277cbf42d2f116c19cd6 --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Saphirus Sage (saphirus497@gmail.com) [12.03.09 00:53]: > 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=3Dbutton[ /]lid.* > action=3D/etc/acpi/actions/lid.sh Looks normal. > /etc/acpi/actions/lid.sh > #!/bin/bash Maybe a=20 sleep 1=20 will help with your issue (or more secs...) > for i in $(cat /proc/acpi/button/lid/LID/state | grep -o closed); do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This only has elements when the lid is closed, so the do=20 block will only be exexuted, if the lid is closed. > if [ $i =3D "closed" ]; then ^^^^^^^^^^^^^^^^^^^^^^^^^^ Therefor this is totally pointless, because we only come to=20 this point if the lid is closed and thus $i is always =3D=3D "clo= sed" > /usr/sbin/pm-suspend > fi > if [ $i !=3D "closed" ]; then > sleep 5 > fi This whole block will never ever be reached, so you can easily erase it. > 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? >=20 You should test if your Desktop Environment does the suspending for you.=20 Then you have to tweak there, to get the behaviour you want. HTH=20 Sebastian --=20 " Religion ist das Opium des Volkes. " Karl Marx SEB@STI@N G=DCNTHER mailto:samson@guenther-roetgen.de --qlTNgmc+xy1dBmNv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (GNU/Linux) iEYEARECAAYFAkm4/GwACgkQ4zavaU1MGbQ2QgCeKTKDJNivAmpPs/hNQ8QucMJK hcEAn13IEyFyAjo5HrOJE0w8pM2R7ZJi =kpBA -----END PGP SIGNATURE----- --qlTNgmc+xy1dBmNv--