diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-09-10 19:56:33 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-11-16 16:38:54 +0100 |
commit | 1b225cd7a0af03a6349c48326118a287fc36acd0 (patch) | |
tree | dff0955221e7fce63e2308febbefdd58213d16c3 /Settings.c | |
parent | 309f1d7282ec8efa4ff6b24a001a4908f5fd28d0 (diff) |
Show CPU temperature in CPU meter
Show the CPU temperature in the CPU meter, like CPU frequency, instead
of using an extra Meter.
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -177,6 +177,12 @@ static bool Settings_read(Settings* this, const char* fileName, int initialCpuCo this->showCPUUsage = atoi(option[1]); } else if (String_eq(option[0], "show_cpu_frequency")) { this->showCPUFrequency = atoi(option[1]); + #ifdef HAVE_LIBSENSORS + } else if (String_eq(option[0], "show_cpu_temperature")) { + this->showCPUTemperature = atoi(option[1]); + } else if (String_eq(option[0], "degree_fahrenheit")) { + this->degreeFahrenheit = atoi(option[1]); + #endif } else if (String_eq(option[0], "update_process_names")) { this->updateProcessNames = atoi(option[1]); } else if (String_eq(option[0], "account_guest_in_cpu_meter")) { @@ -277,6 +283,10 @@ bool Settings_write(Settings* this) { fprintf(fd, "cpu_count_from_one=%d\n", (int) this->countCPUsFromOne); fprintf(fd, "show_cpu_usage=%d\n", (int) this->showCPUUsage); fprintf(fd, "show_cpu_frequency=%d\n", (int) this->showCPUFrequency); + #ifdef HAVE_LIBSENSORS + fprintf(fd, "show_cpu_temperature=%d\n", (int) this->showCPUTemperature); + fprintf(fd, "degree_fahrenheit=%d\n", (int) this->degreeFahrenheit); + #endif fprintf(fd, "update_process_names=%d\n", (int) this->updateProcessNames); fprintf(fd, "account_guest_in_cpu_meter=%d\n", (int) this->accountGuestInCPUMeter); fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme); @@ -309,6 +319,10 @@ Settings* Settings_new(int initialCpuCount) { this->countCPUsFromOne = false; this->showCPUUsage = true; this->showCPUFrequency = false; + #ifdef HAVE_LIBSENSORS + this->showCPUTemperature = false; + this->degreeFahrenheit = false; + #endif this->updateProcessNames = false; this->showProgramPath = true; this->highlightThreads = true; |