I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?

link|improve this question

Couldn't you just close your lid and unplug it and wait a moment. Then open your lid? If it was suspended you would either see it waking up or have to push power to wake it up. – MrStatic Jul 4 '10 at 23:57
What I mean is, if I close the lid and then unplug the laptop. It should suspend, but it doesn't, for reasons that I address in another question: superuser.com/questions/160000/… I'm attacking the problem from two angles, and fake ACPI events is one of them. – Ryan Thompson Jul 5 '10 at 1:04
Look in your /sys/power and see if there is an item for the lid. If there is, you can try writing a different state to it with echo -n "x" . I don't have linux on a laptop to see whats in there. (My source/thoughts from acpi.sourceforge.net/documentation/sleep.html) – Nextraztus Aug 8 '10 at 15:55
feedback

1 Answer

ACPI-FakeKeys might do the trick.

link|improve this answer
There does not appear to be a lid button defined in /usr/share/acpi-support/key-constants, so I can't see how you would generate a lid event using acpi-fakekey – Ryan Thompson Aug 11 '10 at 17:17
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.