! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Make low battery warning level configurable
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-power-manager
Component:
General

Comments

Description Oliver Martin 2009-09-16 19:27:17 CEST
Currently, xfce4-power-manager unconditionally displays a warning message when the battery level reaches 30%. This should be configurable.

On a somewhat related note, it should be possible to set the critical battery level (which is configurable) to less than 5%. I used to use the battery monitor panel applet, where this can be set down to 1% and my laptop reliably suspends even at that level. I know this is probably not good for the battery, but it works for me and I get about 10 minutes more battery runtime when I really need it. Extending well-known Unix philosophy a bit, the rope should not prevent me from hanging myself. A warning would IMHO be a better option than flat out not allowing it.

I'm using version 0.8.3.1 from Debian testing.
Comment 1 Ali Abdallah editbugs 2009-09-28 07:03:40 CEST
(In reply to comment #0)
> Currently, xfce4-power-manager unconditionally displays a warning message when
> the battery level reaches 30%. This should be configurable.
> 

The warning level is calculated from the critical level configured by the user.

> On a somewhat related note, it should be possible to set the critical battery
> level (which is configurable) to less than 5%. I used to use the battery
> monitor panel applet, where this can be set down to 1% and my laptop reliably
> suspends even at that level. I know this is probably not good for the battery,
> but it works for me and I get about 10 minutes more battery runtime when I
> really need it. 

This makes sense, actually this is implemented already in git, now the minimum allowed level is 1%.

Will be released soon.

Let me know if this is enough.
Comment 2 Oliver Martin 2009-09-29 18:40:21 CEST
(In reply to comment #1)
> The warning level is calculated from the critical level configured by the user.

Hmm, it doesn't seem to be. The warning I mean seems to be coming from xfpm-battery.c, line 121:
case BATTERY_CHARGE_LOW:
    return adapter_present ? _("Your battery charge is low") : _("System is running on low power");

BATTERY_CHARGE_LOW is set on line 335:
else if ( percentage >= critical_level && percentage < 30)
{
    *state = BATTERY_CHARGE_LOW;
    return  _("charge is low");
}

> This makes sense, actually this is implemented already in git, now the minimum
> allowed level is 1%.
> 
> Will be released soon.
> 
> Let me know if this is enough.

This would of course be great. I had a look at http://git.xfce.org/apps/xfce4-power-manager/tree/src/xfpm-xfconf.c and 5% still seems to be the minimum for CRITICAL_POWER_LEVEL; is there some other git tree you are referring to?
Comment 3 Ali Abdallah editbugs 2009-09-30 08:03:50 CEST
(In reply to comment #2)
> (In reply to comment #1)
> > The warning level is calculated from the critical level configured by the user.
> 
> Hmm, it doesn't seem to be. The warning I mean seems to be coming from
> xfpm-battery.c, line 121:
> case BATTERY_CHARGE_LOW:
>     return adapter_present ? _("Your battery charge is low") : _("System is
> running on low power");
> 
> BATTERY_CHARGE_LOW is set on line 335:
> else if ( percentage >= critical_level && percentage < 30)
> {
>     *state = BATTERY_CHARGE_LOW;
>     return  _("charge is low");
> }
> 

Ah okay, yeah you right, it should be calculated from the critical charge level.


> > This makes sense, actually this is implemented already in git, now the minimum
> > allowed level is 1%.
> > 
> > Will be released soon.
> > 
> > Let me know if this is enough.
> 
> This would of course be great. I had a look at
> http://git.xfce.org/apps/xfce4-power-manager/tree/src/xfpm-xfconf.c and 5%
> still seems to be the minimum for CRITICAL_POWER_LEVEL; is there some other git
> tree you are referring to?

There is a patch lost somewhere that was supposed to go in 0.8.4, i don't know what happened, but the minimum charge level for 0.8.4 was supposed to be 1%, i'm sorry will be fixed for the next release.

Bug #5765

Reported by:
Oliver Martin
Reported on: 2009-09-16
Last modified on: 2011-02-15

People

Assignee:
Ali Abdallah
CC List:
0 users

Version

Version:
Unspecified

Attachments

Additional information