* Saphirus Sage ([email protected]) [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=button[ /]lid.* > action=/etc/acpi/actions/lid.sh
Looks normal.
> /etc/acpi/actions/lid.sh
> #!/bin/bash
Maybe a
sleep 1
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
block will only be exexuted, if the lid is closed.
> if [ $i = "closed" ]; then
^^^^^^^^^^^^^^^^^^^^^^^^^^
Therefor this is totally pointless, because we only come to
this point if the lid is closed and thus $i is always == "closed"
> /usr/sbin/pm-suspend
> fi
> if [ $i != "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?
>
You should test if your Desktop Environment does the suspending for you.
Then you have to tweak there, to get the behaviour you want.
HTH
Sebastian
--
" Religion ist das Opium des Volkes. " Karl Marx
s...@sti@N GÜNTHER mailto:[email protected]
pgpJB2EZXHSAu.pgp
Description: PGP signature

