Sunday, March 18, 2012

Ubuntu 10.04 sleep computer after 4 hours (or more)

I run my Ubuntu 10.04 tower as my home server and typically, I'd like it stay up for a sufficient amount of time once i start working on it remotely. However, the default Ubuntu configuration allows no granularity between 2 hours and infinity. I typically find that a span of 4 hours is an adequate window for me to login, work and then let the machine save some energy by auto-hibernating.

Not having this option was a little frustrating. Finally, I got around to it today. And again, Google is thy friend.

- launch gconf-editor
- search for (use CTRL + F) sleep_computer_ac key
- change this value to 14400

As always, BACKUP before changing any system configs. For backing up, use

cp -r ~/.gnome ~/work/.gnome-backup-timestamp

How to do it the hardway

If you'd rather do the change manually, e.g. no GUI available, here's the diff.
- open .gconf/apps/gnome-power-manager/timeout/%gconf.xml
- find entry name="sleep_computer_ac"
- change the "value" item to desired value in seconds. In my case this was 14400 (4 hours * 3600 seconds / hour)

diff --recursive .gconf/apps/gnome-power-manager/timeout/%gconf.xml ~/work/backup/.gconf-backup-2012-03-18/apps/gnome-power-manager/timeout/%gconf.xml
4c4
< <entry name="sleep_computer_ac" mtime="1332099330" type="int" value="14400"/>
---
> <entry name="sleep_computer_ac" mtime="1297676987" type="int" value="0"/>

references:

No comments: