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 1LhYEI-0006u4-Df for garchives@archives.gentoo.org; Wed, 11 Mar 2009 23:52:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB4E8E0449; Wed, 11 Mar 2009 23:52:52 +0000 (UTC) Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.145]) by pigeon.gentoo.org (Postfix) with ESMTP id 8A9D6E0449 for ; Wed, 11 Mar 2009 23:52:52 +0000 (UTC) Received: by qw-out-1920.google.com with SMTP id 9so198324qwj.10 for ; Wed, 11 Mar 2009 16:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=N+0ii2oGQMfvZa3BghFkG5VV/ZyccRKjRG3pFjn5PPg=; b=qB8P/XbFAGg8vZaHSjcWk5IwvFOpkPQmMvvIZih6+dsgi6Eq7V/ldkC5PdD3YOVcQS mKJu7XrxwrLRMGTZWNcCzwMJ6avpjSZGMB8TBfaCvc+Sg+MnPN806aQpc07dryPa3oZC xL3JNMHamRokBWp2VvmtivoH8MgvbeFLq4ErM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=tJj8/AoLNu8oBKuJk+IPRBJWP7OIjea+IlcSHRS6AJiWEaoiNlZYeVX4t98hI37Qfo IL78Tvb8SMjvlb5jE6FhYmSPbFnKg1qiiPV9oc/EbKs0VB0QaxcbJhC0qFtZHhP/Bj/1 7RawDkidqaFJ/EyJff9bkqxDaZJxdOGPVu78U= Received: by 10.224.29.13 with SMTP id o13mr1685642qac.103.1236815572312; Wed, 11 Mar 2009 16:52:52 -0700 (PDT) Received: from gentoo-everex.local (cpe-72-185-51-230.tampabay.res.rr.com [72.185.51.230]) by mx.google.com with ESMTPS id 34sm64405yxm.48.2009.03.11.16.52.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Mar 2009 16:52:51 -0700 (PDT) Message-ID: <49B83E34.6070108@gmail.com> Date: Wed, 11 Mar 2009 18:41:56 -0400 From: Saphirus Sage User-Agent: Thunderbird 2.0.0.19 (X11/20081231) 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 To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] Bash and ACPI issue - laptop lid Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: d4969749-249f-42e4-b334-b07dad3ab26e X-Archives-Hash: 3d246a9dd51732e5e932081b1e009caa 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?