diff options
author | Daniel Lange <DLange@git.local> | 2021-02-02 10:32:11 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-02-02 18:03:17 +0100 |
commit | 8fb51627b2e116d7957f57f27aff31ea726d7d86 (patch) | |
tree | 504310c49de1e6b8fa9ca7bd85c309caa4821bab /Settings.c | |
parent | b6122564865526300125ebefad49f9649c687d27 (diff) |
Improve initial setup for systems with many CPUs
Resolves #435
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -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"); |