Gentoo Archives: gentoo-user

From: Saphirus Sage <saphirus497@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Bash and ACPI issue - laptop lid
Date: Wed, 11 Mar 2009 23:52:54
Message-Id: 49B83E34.6070108@gmail.com
1 I've been trying to setup my laptop to enter ACPI S3 (suspend to ram)
2 when I close the lid. I currently have the scripts setup as such:
3 /etc/acpi/events/lid
4 event=button[ /]lid.*
5 action=/etc/acpi/actions/lid.sh
6 /etc/acpi/actions/lid.sh
7 #!/bin/bash
8 for i in $(cat /proc/acpi/button/lid/LID/state | grep -o closed); do
9 if [ $i = "closed" ]; then
10 /usr/sbin/pm-suspend
11 fi
12 if [ $i != "closed" ]; then
13 sleep 5
14 fi
15 done
16 The issue I've run into is that this will cause my laptop to suspend to
17 the RAM upon any change in the lid state, irregardless of if it is open
18 or closed. I tried to be more specific by utilizing the suffix of the
19 event, but it's incremental, which is a bit beyond my abilities. Any
20 suggestions to make this suspend only when the lid is closed?

Replies

Subject Author
Re: [gentoo-user] Bash and ACPI issue - laptop lid Mike Kazantsev <mike_kazantsev@×××××××.net>
Re: [gentoo-user] Bash and ACPI issue - laptop lid "Sebastian Günther" <samson@××××××××××××××××.de>