As I had the same issue (on different hardware) and it seems as the
value at /sys/class/power_supply/BAT0/current_now contains a negative
values which is interpreted as 0.

The attached simple patch worked fine for me.
--- lxpanel-0.5.8.orig/src/plugins/batt/batt_sys.c
+++ lxpanel-0.5.8/src/plugins/batt/batt_sys.c
@@ -160,7 +160,8 @@ void battery_update( battery *b ) {
 		    b->state = "available";
 	    }
 	    else if ( strcmp("current_now", sys_file ) == 0 ) {
-		b->present_rate = get_unit_value((gchar*) file_content) / 1000;
+		int d = get_unit_value((gchar*) file_content);
+		b->present_rate = d != -1 ? abs(d) / 1000 : 0;
 	    }
 	    else if ( strcmp("charge_full", sys_file ) == 0 ) {
 		b->last_capacity = get_unit_value((gchar*) file_content) / 1000;

Reply via email to