[clug] Laptop to go into suspend-to-ram.

Cameron Patrick cameron at patrick.wattle.id.au
Sun Nov 6 08:33:17 GMT 2005


Arafangion wrote:

> I do have a button on the laptop that I feel that could be used to enter 
> suspend-to-ram, however I am not sure how one maps the key to a command.
> 
> I cannot get the keycode by pressing ^V<key>, so some howto or suggestion 
> would be appreciated.

It probably generates an ACPI event which you can configure acpid to
listen for and start a shell script.  You can run acpi_listen to find
out what events it's giving and then twiddle /etc/acpi/ appropriately.

> The laptop does successfully enter and leave suspend-to-ram, via echo -n 3 | 
> tee /proc/acpi/sleep

You will probably find that you have to unload some modules before
suspending and reload them afterwards for it to work reliably;
e.g. USB is a common culprit for not support suspend properly.

You can use the hibernate script that was designed for suspend2 to
automate most of this.  You can grab it from http://www.suspend2.net/
or if it may be packaged with your distro already (Debian/Ubuntu have
the 'hibernate' package; Gentoo has hibernate-script).  You'll need to
edit the config file since the default is to use suspend2.

Cameron
(Currently in Perth, but heading to Canberra in a couple of weeks' time)



More information about the linux mailing list