3

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.

5
  • 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. Oct 21, 2012 at 23:25
  • try and force it by gsettings set org.gnome.settings-daemon.plugins.power button-power 'suspend'. Oct 21, 2012 at 23:46
  • check out this related post, it might be helpful. Oct 22, 2012 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! Oct 22, 2012 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. Oct 22, 2012 at 20:07

1 Answer 1

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
2
  • This worked, but when I resume after suspend, the system immediately suspends again. This only happens once for each time I push the button, though, so it's still useful.
    – GordonM
    Jun 15, 2016 at 5:47
  • Looks like the script is executed twice. Maybe there should be created lock file in the script to prevent executing it twice (if lock file exist script would simply exit). Then the lock file should be removed somehow after wake up. Jun 15, 2016 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .