[Pkg-lxde-maintainers] Bug#636868: lxpanel: Battery monitor plugin always display 100% of capacity

Hiroyuki Takashima jbk.shack at gmail.com
Sat Aug 6 15:31:02 UTC 2011


Package: lxpanel
Version: 0.5.8-1
Severity: normal
Tags: patch

My laptop is ASUS EeePC 900A.

In case of charge_now and charge_full is exists,
energy_now and energy_full is not exists,
battery remaining capacity percentage always display 100.

In similar case of #580509,energy_now and energy_full is exists,
charge_now and charge_full is not exists,
will just work fine.

/sys/class/power_supply/BAT0 directory (filename: file content):
alarm:0
charge_full:4044000
charge_full_design:4387000
charge_now:1702000
current_now:1085000
cycle_count:0
manufacturer:ASUS
model_name:900A
present:1
serial_number:
status:Discharging
technology:Li-ion
type:Battery
uevent:
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=8400000
POWER_SUPPLY_VOLTAGE_NOW=7460000
POWER_SUPPLY_CURRENT_NOW=1074000
POWER_SUPPLY_CHARGE_FULL_DESIGN=4387000
POWER_SUPPLY_CHARGE_FULL=4044000
POWER_SUPPLY_CHARGE_NOW=1677000
POWER_SUPPLY_MODEL_NAME=900A
POWER_SUPPLY_MANUFACTURER=ASUS
POWER_SUPPLY_SERIAL_NUMBER= 
voltage_min_design:8400000
voltage_now:7460000

acpi(package:acpi) command work correctly.
$ acpi -V
Battery 0: Discharging, 42%, 01:35:56 remaining
Battery 0: design capacity 4387 mAh, last full capacity 4044 mAh = 92%
Adapter 0: off-line
Thermal 0: ok, 51.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 90.0 degrees C
Thermal 0: trip point 1 switches to mode passive at temperature 80.0 degrees C
Cooling 0: Processor 0 of 10
Cooling 1: Processor 0 of 10

Fixed by the followinig patch
(become the behavior similar as print_battery_information() in acpi.c):

--- lxpanel-0.5.8/src/plugins/batt/batt_sys.c.orig	2011-07-29 21:37:01.000000000 +0900
+++ lxpanel-0.5.8/src/plugins/batt/batt_sys.c	2011-08-06 22:45:52.773900071 +0900
@@ -220,7 +220,7 @@
     if (b->last_capacity < MIN_CAPACITY)
 	b->percentage = 0;
     else
-	b->percentage = ((float) b->remaining_energy * 100.0) / (float) b->last_capacity_unit;
+	b->percentage = ((float) b->remaining_capacity * 100.0) / (float) b->last_capacity;
 	    
     if (b->percentage > 100)
 	b->percentage = 100;

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lxpanel depends on:
ii  libasound2                    1.0.24.1-2 shared library for ALSA applicatio
ii  libatk1.0-0                   2.0.1-2    ATK accessibility toolkit
ii  libc6                         2.13-13    Embedded GNU C Library: Shared lib
ii  libcairo2                     1.10.2-6.1 The Cairo 2D vector graphics libra
ii  libfontconfig1                2.8.0-3    generic font configuration library
ii  libfreetype6                  2.4.6-1    FreeType 2 font engine, shared lib
ii  libgdk-pixbuf2.0-0            2.23.5-3   GDK Pixbuf library
ii  libglib2.0-0                  2.28.6-1   The GLib library of C routines
ii  libgtk2.0-0                   2.24.5-4   GTK+ graphical user interface libr
ii  libmenu-cache1                0.3.2-2.1  an implementation of the freedeskt
ii  libpango1.0-0                 1.28.4-2   Layout and rendering of internatio
ii  libx11-6                      2:1.4.4-1  X11 client-side library
ii  lxmenu-data                   0.1.2-1    freedesktop.org menu specification

Versions of packages lxpanel recommends:
pn  manpages-dev                  <none>     (no description available)

Versions of packages lxpanel suggests:
ii  chromium [www-brow 13.0.782.107~r94237-1 Chromium browser
ii  lxsession [lxsessi 0.4.6.1-1             default session manager for LXDE
ii  menu               2.1.45                generates programs menu for all me
ii  w3m [www-browser]  0.5.3-3               WWW browsable pager with excellent

-- no debconf information





More information about the Pkg-lxde-maintainers mailing list