Xubuntu Gutsy: Laptop suspend on lid close
I’d assume the following works in different Ubuntu versions in general:
Suspend worked out of the box, but closing the lid didn’t do anything but blank the screen. First, I installed gnome-power-manager and fiddled with gnome-power-preferences. I was able to get it to suspend on lid close, but now suspend didn’t work reliably anymore — about every fifth time the laptop would fail to suspend. So I uninstalled gnome-power-manager.
Turns out, all I had to do was edit /etc/acpi/events/lidbtn and change one line:
From:
action=/etc/acpi/lid.sh
To:
action=/etc/acpi/sleep.sh
Works.