Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to configure Ubuntu so that the power button causes suspend regardless of whether the session is locked or not?

See here, for example. That configuration does not work, however, if the session is locked.

Note that my question is essentially the same as this one, but the given answer doesn't fully answer the question.

share|improve this question
    
please don't post duplicate questions, offer a bounty instead on the existing post, if you think the accepted answer does not properly address the question asked. another alternative is to comment on the answer to ask the poster to revise his/her answer. –  Eliran Malka Oct 21 '12 at 23:25
    
try and force it by gsettings set org.gnome.settings-daemon.plugins.power button-power 'suspend'. –  Eliran Malka Oct 21 '12 at 23:46
    
check out this related post, it might be helpful. –  Eliran Malka Oct 22 '12 at 0:30
    
@Eliran: Indeed, I already linked to the post you mention. It does not work when the session is locked. Your comment regarding duplicates is still valid, though. I have offered a bounty for the original question. I invite others to improve the answer! –  Adam Paetznick Oct 22 '12 at 19:31
    
great, by the way, have you tried deciphering the content of /etc/acpi/powerbtn.sh? it seems like it all comes down to the logic in that file. good luck anyhow. –  Eliran Malka Oct 22 '12 at 20:07

1 Answer 1

Maybe not the cleanest solution, but works for me. To resolve the issue I added following at the beginning of file /etc/acpi/powerbtn.sh:

/usr/sbin/pm-suspend
exit 0
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.