commit 525d3b620139ed9b5bf3e22d4c15947c5678d13c
parent b3d37a31b88f1bf1bb297c5994961efff0ba7937
Author: hhvn <dev@hhvn.uk>
Date: Thu, 14 Apr 2022 17:23:04 +0100
Recolour CPU bars
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/handlers/cpu.c b/handlers/cpu.c
@@ -120,7 +120,14 @@ main(void) {
#endif
for (i = 0; percent[i] && i < MAXCORES; i++) {
s2d_bg(BRBG);
- s2d_reset(1, 0);
+ if (percent[i] >= 80)
+ s2d_fg(RED);
+ else if (percent[i] >= 65)
+ s2d_fg(ORANGE);
+ else if (percent[i] >= 50)
+ s2d_fg(YELLOW);
+ else
+ s2d_fg(GREEN);
s2d_bar(0, 2, 3, bar_height - 4, 1, percent[i]);
s2d_reset(0, 1);
s2d_forward(-1);