new powermanager and battery

Hervé Fache Herve at
Fri Sep 1 14:22:15 BST 2006

On 9/1/06, Sebastian Kügler <sebas at> wrote:
> It certainly helps a bit about getting to know what a user (!=me) would want.
> Here's my take: I want to know 15 minutes from battery is empty.


> Currently, I've implemented two levels: BATTERY_WARNING (set to 8%) and
> BATTERY_CRITICAL (set to 4%). BATTERY_WARNING shows a passive popup,
> notifying of a battery running low, BATTERY_CRITICAL shows a popup and
> suspends (that one is configurable) immediately. Thinking of that, maybe a
> timeout and the option to cancel it would be nice, but then I'm using
> suspend2 and I can cancel while suspending anyway.

Hopefully uswsusp will support the Escape key too? Rafael said it would, see:
(search for 'going to implement').

> One of the problems using minutes as a unit is that it depends on the battery
> and usage scenario. Here's an example: I'm idling for some time now thus
> using hardly any battery power, the battery is running out and I only have
> one minute left so the hibernate kicks in. Hibernate uses the disk and more
> processor power (it might even be compressing the image) and all of a sudden,
> I use 3 times as much energy than while idling. The minute left is
> effectively only 20 seconds anymore and hibernate might die in the process
> running out of power.

I quite understand your point! Probably percents are acceptable, but
they still don't give a clear notion of time left, neither to the user
who probably wants to know it, nor to the machine which 'knows' it
needs one minute to hibernate, independent from power left. It's a
nice little problem you have here!

Stupid ideas, feel free to ignore:
- for time left warnings, use current power consumption (maybe using a
10-minute sliding average?)
- for hibernate, keep a record of highest power consumption ever and
compute delay based on that. Anyway, and as you pointed out, the
hibernate process is likely to reach close to highest power
consumption: CPU, memory, hard disk all at once and at full speed

> My conclusion would be that we should use percent as a unit and make the
> numbers configurable for varying battery capacities -- 10 minutes might be 8%
> based on a 2h battery, it might be 5% based on a 4h battery. Worn-out
> batteries might be another use case.
> In the UI (tooltip), we would then need to display both, percent remaining and
> minutes remaining based on current rate.

In the end, this is up to you, but somehow, I know you know that
minutes would be nicer ;-)

Good luck!

More information about the kubuntu-devel mailing list