blob: bae69f553ced3f459802e2c3cb900bcd586e47fc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
From 8fb51627b2e116d7957f57f27aff31ea726d7d86 Mon Sep 17 00:00:00 2001
From: Daniel Lange <DLange@git.local>
Date: Tue, 2 Feb 2021 10:32:11 +0100
Subject: [PATCH] Improve initial setup for systems with many CPUs
Resolves #435
---
Settings.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/Settings.c b/Settings.c
index 6c8f8894..f12a51f4 100644
--- a/Settings.c
+++ b/Settings.c
@@ -55,7 +55,7 @@ static void Settings_readMeterModes(Settings* this, const char* line, int column
static void Settings_defaultMeters(Settings* this, int initialCpuCount) {
int sizes[] = { 3, 3 };
- if (initialCpuCount > 4) {
+ if (initialCpuCount > 4 && initialCpuCount <= 128) {
sizes[1]++;
}
for (int i = 0; i < 2; i++) {
@@ -64,7 +64,22 @@ static void Settings_defaultMeters(Settings* this, int initialCpuCount) {
this->columns[i].len = sizes[i];
}
int r = 0;
- if (initialCpuCount > 8) {
+
+ if (initialCpuCount > 128) {
+ // Just show the average, ricers need to config for impressive screenshots
+ this->columns[0].names[0] = xStrdup("CPU");
+ this->columns[0].modes[0] = BAR_METERMODE;
+ } else if (initialCpuCount > 32) {
+ this->columns[0].names[0] = xStrdup("LeftCPUs8");
+ this->columns[0].modes[0] = BAR_METERMODE;
+ this->columns[1].names[r] = xStrdup("RightCPUs8");
+ this->columns[1].modes[r++] = BAR_METERMODE;
+ } else if (initialCpuCount > 16) {
+ this->columns[0].names[0] = xStrdup("LeftCPUs4");
+ this->columns[0].modes[0] = BAR_METERMODE;
+ this->columns[1].names[r] = xStrdup("RightCPUs4");
+ this->columns[1].modes[r++] = BAR_METERMODE;
+ } else if (initialCpuCount > 8) {
this->columns[0].names[0] = xStrdup("LeftCPUs2");
this->columns[0].modes[0] = BAR_METERMODE;
this->columns[1].names[r] = xStrdup("RightCPUs2");
|