[Goodies-dev] [xfce4-battery-plugin][Patch] Show current power usage

Raphael Groner raphgro at web.de
Fri Nov 16 12:32:20 CET 2012


yeah, bugzilla seems to be the right place for patches like yours.
Downstreams could catch the patch and apply the patch in their own
responsibility or cause of need to their individual packages, when
no active upstream is available.

I think the battery plugin is still maintained. At least, we had a
short discussion recently [1] about my suggestion merging it into the
source of the power manager.

Oh, I can see that bz is already full with similar bugs, e.g. [2].

Without having looked into the source in much detail, I would like to
add some ideas.

Are you sure that /sys/class/power_supply/BAT{x}/power_now is available
on every machine Xfce is running on? Me is not. What happens to the
battery plugin when there's no battery at all? :)

Maybe it's better to show also the maximal power, e.g. "x/y W" where x
is the current usage and y the maximum. You could calculate the
maximum, or get it simply from file system if provided so.


[1] https://bugzilla.xfce.org/show_bug.cgi?id=4499
[2] https://bugzilla.xfce.org/show_bug.cgi?id=6652 

Am Fri, 16 Nov 2012 12:00:02 +0100
schrieb goodies-dev-request at xfce.org:

> Date: Fri, 16 Nov 2012 08:08:58 +0100
> From: Yves-Alexis Perez <corsac at debian.org>
> To: Xfce Goodies development discussion <goodies-dev at xfce.org>
> Subject: Re: [Goodies-dev] [xfce4-battery-plugin][Patch] Show current
> 	power usage
> Message-ID: <1353049738.17241.93.camel at scapa>
> Content-Type: text/plain; charset="utf-8"
> On jeu., 2012-11-15 at 09:16 +0100, David Rosca wrote:
> > Hi,
> > I have made a small patch that adds support for showing current
> > power usage (in Watts)
> > next to approximate remaining time. So in panel, it will be shown
> > like:
> >         
> >                                     04:25 (9 W)
> > 
> > It is using data from libacpi.c
> > (from /sys/class/power_supply/BAT{x}/power_now).
> > It is working great for my laptop (Thinkpad X220) running 3.5.7
> > kernel. It may however need
> > some tweaking to get it working properly on every laptop.
> > 
> > Current power usage will only be shown when on battery (I
> > used !acline check, so I hope it's correct).
> > I have integrated it into remaining time box because i didn't want
> > to create a new box just for this.
> > 
> > I'm not really sure if I can send attachements to mailing lists, so
> > I will append the patch at the end
> > of the mail.
> > 
> > Please let me know what you think about this patch.
> > 
> Can you please attach it to bugzilla so it doesn't get lost? However,
> I'm unsure if the battery plugin is really maintained these days, so
> it might be a bit hard to have it reviewed and committed?
> Regards,

More information about the Goodies-dev mailing list