# HG changeset patch # User Stiletto # Date 1566040995 -14400 # Node ID e08bdbec1843488604d0d152aea2f48125bac021 # Parent 163e96e2b941cd2d4b9fb7ef04d6b99be75c7f21 Fix battery indicator diff -r 163e96e2b941 -r e08bdbec1843 status-bat/bat.c --- a/status-bat/bat.c Mon Oct 17 14:23:58 2016 +0400 +++ b/status-bat/bat.c Sat Aug 17 15:23:15 2019 +0400 @@ -135,24 +135,25 @@ char *status = catfile(filename); int remtime = 0; - char *arrow; + char *arrow = "—"; - remtimes_color = color_none; + arrow_color = color_none; + remtimes_color = color_green; + if (!strcmp(status,"Charging")) { - if (current_now != 0) + if (current_now != 0) { remtime = (charge_full-charge_now) / (current_now/60); - arrow = "↑"; - arrow_color = color_orange; + arrow = "↑"; + arrow_color = color_orange; + } } else if (!strcmp(status,"Discharging")) { - if (current_now != 0) + if (current_now != 0) { remtime = charge_now / (current_now/60); - arrow = down_arrow; - arrow_color = color_none; - remtimes_color = color(20,120,0,remtime); - } else { - arrow = "—"; - arrow_color = color_green; + arrow = down_arrow; + arrow_color = color_none; + remtimes_color = color(20,120,0,remtime); + } } free(status); diff -r 163e96e2b941 -r e08bdbec1843 status-bat/config.def.h --- a/status-bat/config.def.h Mon Oct 17 14:23:58 2016 +0400 +++ b/status-bat/config.def.h Sat Aug 17 15:23:15 2019 +0400 @@ -3,4 +3,5 @@ /* Uncomment this if you want status-bat to drain the fuck out of your already dying battery by flashing remaining time indicator */ //#define DRAIN_THE_FUCK + //#define PANGO_MARKUP // use second argument instead