commit 127d0dab8d494339480edc6f65918c54ad9d561c
parent c8461339bba65a1c1d8b9cb0587f4f111dfc7446
Author: hhvn <dev@hhvn.uk>
Date: Fri, 15 Apr 2022 23:26:47 +0100
Multiple colours indicating battery percentage
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bat.c b/bat.c
@@ -105,8 +105,12 @@ main(void) {
/* fill battery */
s2d_fg(BRBG);
s2d_rect(4, 4, iw, ih);
- if (percent < 25)
+ if (percent < 10)
s2d_fg(RED);
+ else if (percent < 20)
+ s2d_fg(ORANGE);
+ else if (percent < 30)
+ s2d_fg(YELLOW);
else
s2d_reset(1, 0);
s2d_rect(4 + iw - w, 4, w, ih);