Sunday, November 7, 2010

Ubuntu 10.10 disabling suspend on lid close

The default settings in Ubuntu on a laptop include suspending with the cover is closed, which is reasonable for normal laptop usage, however I am building a server from a laptop with a broken screen, so it will be closed and in the corner most of the time, and not being suspended would be a good thing.

The method that I used on Ubuntu 10.04 did not seem to work, and the control panel does not seem to have the options available on this laptop, so I had to figure out another way to do it.

After reading on how to change some other power manager settings, I came up with a command that changes the settings I want to change. However this just changed it when my user was logged in to the console, to change the default required the commands I had used before and a restart to gdm to load the changed settings.

# make the changes
sudo gconftool-2 \
 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
 /apps/gnome-power-manager/buttons/lid_ac --set --type string nothing
sudo gconftool-2 \
 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
 /apps/gnome-power-manager/buttons/lid_battery --set --type string nothing

# restart gdm
sudo /etc/init.d/gdm restart

The current settings can be viewed with
gconftool-2 /apps/gnome-power-manager/buttons -R

Now the laptop does not suspend when the cover is closed.

No comments:

Post a Comment