Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|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:… 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 – Nextraztus Aug 8 '10 at 15:55

ACPI-FakeKeys might do the trick.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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