diff --git a/lxpanel/src/plugins/batt/batt_sys.c b/lxpanel/src/plugins/batt/batt_sys.c index 62445fe..7b7def5 100644 --- a/lxpanel/src/plugins/batt/batt_sys.c +++ b/lxpanel/src/plugins/batt/batt_sys.c @@ -217,6 +217,8 @@ void battery_update(battery *b) b->percentage = 0; else { int promille = (b->energy_now * 1000) / b->energy_full; + if (b->energy_now == -1 || b->energy_full == -1) + promille = (b->charge_now * 1000) / b->charge_full; b->percentage = (promille + 5) / 10; /* round properly */ } if (b->percentage > 100)