Changing the critical battery power level for system shutdown in Ubuntu

Tested and working under:

  • Ubuntu 11.10 (“Oneiric”)
  • Ubuntu 12.04 (“Precise”)
  • Ubuntu 12.10 (“Quantal”)
  • Ubuntu 13.04 (“Raring”)
  • Ubuntu 13.10 (“Saucy”)

On my Dell Inspiron i have had the problem of Ubuntu not shutting down the system early enough. As a result, the computer just gets banged off, potentially suffering data loss.

I googled a bit and found some info about changing the “critical” and “action” thresholds in gconf-editor under “apps->gnome-power-manager”, but the whole gnome-power-manager subtree does not exist in Oneiric anymore.

Instead, you’ll have to do this via shell, which is less a pain in the ass than it sounds like.

You can list your current settings by typing:

user@hostname:~$ gsettings list-recursively org.gnome.settings-daemon.plugins.power

The output probably includes something like

org.gnome.settings-daemon.plugins.power percentage-action 2
org.gnome.settings-daemon.plugins.power percentage-critical 5
org.gnome.settings-daemon.plugins.power percentage-low 10

This means your system says “battery low” at 10 percent, “battery critical” at 5 percent, and shutdown “action” is taken at 2 percent.

I changed critical to 7 and action to 5 percent, which works just fine. Here’s the commands to issue:

user@hostname:~$ gsettings set org.gnome.settings-daemon.plugins.power percentage-critical 7
user@hostname:~$ gsettings set org.gnome.settings-daemon.plugins.power percentage-action 5

I wonder why they removed the settings from gconf-editor in the first place.

Update: Do

rephlex@avis:~$ gsettings set org.gnome.settings-daemon.plugins.power use-time-for-policy false

for the changes to take effect, or else the percentage values we defined will be ignored, and the estimated runtime will be used – which is not what we want.

One Comment

  1. Launch dconf-editor (not gconf-editor) and go to “org > gnome > settings-daemon > plugins > power” ;).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.