xfce4-battery-plugin: Fix battery capacity detection
I've noticed that on some devices the battery plugin wasn't working properly (no battery icon on the panel), so I've investigated and noticed how the percentage was calculated.
It basically expect to find the last_full_capacity
with the total amount of mAh of the battery and energy_now
or charge_now
with the current amount of remaining mAh.
Since I've almost never seen those values in my devices, but most of them (if not all) have the capacity
with the actual remaining percentage, I've decided to patch it to read and use that information.
I've tried to not break the actual logic, so if a device have both last_full_capacity
and energy_now
or charge_now
it will continue use the old logic.
If someone also noticed the missing battery icon in the xfce4 panel, please test with this patched plugin and report back. Thanks