nix/files/i3status.patch
2024-07-05 01:29:46 +02:00

34 lines
1.4 KiB
Diff

From 9758bc03df33fc0d6e61b2be86e3efe714b90dee Mon Sep 17 00:00:00 2001
From: krizej <60076189+krizej@users.noreply.github.com>
Date: Fri, 5 Jul 2024 01:17:31 +0200
Subject: [PATCH] japierdole
---
src/print_cpu_usage.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/print_cpu_usage.c b/src/print_cpu_usage.c
index a7ee2e4..1821a99 100644
--- a/src/print_cpu_usage.c
+++ b/src/print_cpu_usage.c
@@ -201,7 +201,7 @@ void print_cpu_usage(cpu_usage_ctx_t *ctx) {
*(outwalk++) = *walk;
} else if (BEGINS_WITH(walk + 1, "usage")) {
- outwalk += sprintf(outwalk, "%02d%s", diff_usage, pct_mark);
+ outwalk += sprintf(outwalk, "%d%s", diff_usage, pct_mark);
walk += strlen("usage");
}
#if defined(__linux__)
@@ -217,7 +217,7 @@ void print_cpu_usage(cpu_usage_ctx_t *ctx) {
int cpu_diff_idle = curr_cpus[number].idle - prev_cpus[number].idle;
int cpu_diff_total = curr_cpus[number].total - prev_cpus[number].total;
int cpu_diff_usage = (cpu_diff_total ? (1000 * (cpu_diff_total - cpu_diff_idle) / cpu_diff_total + 5) / 10 : 0);
- outwalk += sprintf(outwalk, "%02d%s", cpu_diff_usage, pct_mark);
+ outwalk += sprintf(outwalk, "%d%s", cpu_diff_usage, pct_mark);
}
walk += length;
}
--
2.45.1