3

Possible Duplicate:
How do I modify the power options?

I'd like to shutdown my laptop by closing the lid; but in Power Settings there's no option to do that.

Is there any way to add "shutdown" to the pop-down list in the power settings for "when the lid is closed"? I prefer the way through the terminal without installing a third-party application.

1

1 Answer 1

2

Unfortunately, you cannot add this option to the menu, because it is a hard coded list of options. You would have to write a script runs in the background that detects the lid being closed and activates the shutdown automatically.

The command you need (to check to see if the lid is closed is):

cat /proc/acpi/button/lid/LID0/state

Now, I'm no scripting junkie (bash scripting I mean), so maybe someone can edit this and give you a proper answer.

4
  • Thank you Roland for the start point. I'll keep searching.
    – AliN
    Sep 15, 2012 at 14:36
  • @AliNa: does the answer here: How do I modify the power options in Ubuntu 11.10? work for you?
    – RolandiXor
    Sep 15, 2012 at 14:39
  • Oh, yes :)) this function works properly in 12.04.1. But I guess some others may not work; for example, changing "Windows > Action on title-bar middle-click" doesn't.
    – AliN
    Sep 16, 2012 at 21:39
  • @AliNa: some features will not work, but I was specifically asking about the shutdown on lid close option.
    – RolandiXor
    Sep 16, 2012 at 22:51

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