]> git.sur5r.net Git - i3/i3status/commitdiff
Added condition, for red color, when battery-time is low, namely battery is discharging
authorMarcel Hellwig <keks@cookiesoft.de>
Sun, 8 Jul 2012 19:47:42 +0000 (21:47 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 9 Jul 2012 13:12:43 +0000 (15:12 +0200)
src/print_battery_info.c

index f6f238c8c0da46d61dcb386d97c440df832597aa..3e0c3020dd892f9505c5f0c5eb97e4440ebccbc3 100644 (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",