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? |