all repos — tint2 @ fea91746a493e466221880e8eb67a78ed3f7980b

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Battery: do not show negative durations when the sensors return garbage
o9000 mrovi9000@gmail.com
commit

fea91746a493e466221880e8eb67a78ed3f7980b

parent

9d8350dabc1c33d5872a762e6c22573799165f74

1 files changed, 1 insertions(+), 0 deletions(-)

jump to
M src/battery/linux.csrc/battery/linux.c

@@ -437,6 +437,7 @@ if (state->state == BATTERY_CHARGING)

seconds = 3600 * (total_energy_full - total_energy_now) / total_power_now; else if (state->state == BATTERY_DISCHARGING) seconds = 3600 * total_energy_now / total_power_now; + seconds = MAX(0, seconds); } battery_state_set_time(state, seconds);