Added condition, for red color, when battery-time is low, namely battery is discharging

This commit is contained in:
Marcel Hellwig 2012-07-08 21:47:42 +02:00 committed by Michael Stapelberg
parent 859a7690a6
commit ccc31f0b80

View File

@ -121,7 +121,7 @@ void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char
minutes = seconds / 60;
seconds -= (minutes * 60);
if (threshold > 0 && seconds_remaining < 60 * threshold)
if (status == CS_DISCHARGING && threshold > 0 && seconds_remaining < 60 * threshold)
START_COLOR("color_bad");
(void)snprintf(remainingbuf, sizeof(remainingbuf), "%02d:%02d:%02d",