How to Prevent Ubuntu from Locking Screen When Laptop Lid is Closed

power-managementUbuntu

I am running Ubuntu 9.04. When my laptop is plugged into power and I close the lid, it only turns off the screen, so when I open it up again, it comes back right away, and I can give use my media keys on the outside while it is closed.

But when I am running on battery and I close the lid, the laptop locks. This is kind of annoying, as I then have to retype my password when I resume, and my media keys don't work. It is also unnecessary since I'm not worried about the security of my laptop.

So my question is, how can I make Ubuntu not lock my screen (require a password when I come back) when I close my lid on battery?

Edit: I would like to note, that currently the power settings are set to "Blank Screen" on laptop close on battery. This causes the current behavior.

Also on some further investigation, the screen does not turn off while I am plugged in, because that power profile says to do nothing (to avoid the password). This is not acceptable for battery use, because of the power drain.

Best Answer

Ok, so I did some digging, and I found how to configure this behavior.

In gconf-editor the key /apps/gnome-power-mananager/lock/blank_screen controls whether to lock the screen when it is blanked or not. In my case it was checked, so I unchecked. Now it works exactly how I like.

I still wish that they exposed this in the power settings, but oh well.

Also, the key /apps/gnome-power-manager/buttons/lid_ac and /apps/gnome-power-manager/buttons/lid_battery controls what to do when the lid is closed using ac or battery respectively. The options are "suspend", "hibernate", "blank" and "nothing". Using "nothing" will keep your external monitor alive when the lid is closed.

Related Question