Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In KDE, I have set my preferences so that if I unplug my laptop and then close the lid, it will go into sleep mode. However, if I close the lid first and then unplug it, it will not suspend.

More specifically, I have KDE set up to choose one of two profiles based on whether or not the AC adapter is plugged in. (This is the default.) The "plugged-in" profile is set to turn off the screen when the lid is closed, while the "no plugged in" profile is set to go to sleep mode when the lid is closed. If the lid is already closed when I unplug the laptop, it will still switch profiles, but it will not trigger the new action because the lid status has not changed.

So is there a way to trigger the appropriate lid action whenever I plug or unplug the laptop? Alternatively, is there a way to automatically generate a fake lid ACPI event when I plug or unplug the laptop?


Further info: KDE Bug Report

share|improve this question
    
I think you have already taken the corrective action - filed a bug report! –  sml Jul 20 '10 at 19:21

2 Answers 2

On ACPI events acpid runs a action as specified in the files under /etc/acpi/events (see the acpid man page for more about this). You can use this to run your own action, acpi_listen can help you to find the ACPI event.

I guess you can get the current lid status somewhere under /proc/acpi/

Maybe there's a better way to do this using the KDE power manager but I don't use KDE.

share|improve this answer
    
I would like for KDE to initiate the suspend action, so that it will also perform all the other steps that it does when suspending. –  Ryan Thompson Jul 8 '10 at 16:56
up vote 1 down vote accepted

According to my Bug Report, this is now fixed.

share|improve this answer

Your Answer

 
discard

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.