GNOME Bugzilla – Bug 152658
gnome power management
Last modified: 2011-08-05 13:58:22 UTC
To reproduce: 1. install gnome-applets-2.7.3 onto your laptop 2. remove power cord 3. watch as laptop runs out of battery and just laptop just dies Actions expected: At 1% battery life shutdown the system using a command (entered like the suspend command, in a textbox) Extra points for dimming the screen at say, 50% :)
I'm of two minds about this, one says this should be handled by acpid, where is can be run with all the correct permissions and such, except that I can't work out how to do this with acpid without adding another process to read battery information. Of course, since we've already got a process reading the battery information (ie. battstat) perhaps it should go in there, or perhaps battstat should send out a dbus event that something can use. I wonder how this is done in Ubuntu if at all.
I figured that the battstat applet should be easy to add a second textbox, say "Shutdown" that contains by default "shutdown -h now" - changes to the core code should be minimal. You wouldn't need the shutdown command if you were say a desktop user, and wouldn't have the applet running. Certainly a DBUS event would be an OK way of doing this, but then we need to design a listener for this event, and therefore another service. Surely the applet should just issue a shutdown -h now (after a warning) and let shutdown decide whether to use APM or ACPI. A better way to solve this is using the ideas from project utopia: http://mail.gnome.org/archives/utopia-list/2004-May/msg00019.html This would send a DBUS event to any application (such as battstat, or lcdbrightness applet) which decouple the actions from the GUI so that other programs can use the DBUS bindings for power management. This could be expanded for other things that use ACPI, like setting the screen brightness, querying the battery levels, and processor speeds. Then the applet can concentrate on the UI side of things, and not have to worry about the "shutdown -h now" type of thing. I'm not sure what sort of thing the Gnome community wants - DBUS acpi implementation to power-management or just a quick bodge that quickly does the job.
The comments here led me to envision a all encompasing power management daemon, PowerManager. http://live.gnome.org/PowerManager
Wow, this is exactly like I thought. If you want any help with UI, or backend code give me a shout. This link may be of help : http://article.gmane.org/gmane.comp.freedesktop.hal/1341 Thanks!!
This shouldn't be handled by GNOME. What if the user isn't logged in or doesn't have a battery status applet loaded? Closing.
Fixed in gnome-settings-daemon :-)