Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The awesome WM doesn't suspend automatically when closing the lid, so I followed some instructions to get it working. I simply added a file /etc/acpi/local/lid.sh.post with the following contents:

#!/bin/sh
pm-suspend

Suspending works now, but after I open the lid and press the power button it shows the desktop for a fraction of a second before suspending again! The second time I press the power button it resumes properly. After that, any time I suspend I have to press the power button and wait three times before it resumes properly. I've tried suspending four times in a row, and it doesn't seem to get any worse.

Solved! If anybody else wants it, I made a script to do this in one command.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I'm pretty sure that your lid callback is going to be called every time the lid is closed as well as opened.

The sleep.sh file here states:

# if launched through a lid event and lid is open, do nothing
echo "$1" | grep "button/lid" && grep -q open /proc/acpi/button/lid/LID/state && exit 0

the "lid open" scenario is one your script is not checking for...

You could quickly test this by echoing some parameters to a log file

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.