summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-09-10 19:56:33 +0200
committerChristian Göttsche <cgzones@googlemail.com>2020-11-16 16:38:54 +0100
commit1b225cd7a0af03a6349c48326118a287fc36acd0 (patch)
treedff0955221e7fce63e2308febbefdd58213d16c3 /Settings.c
parent309f1d7282ec8efa4ff6b24a001a4908f5fd28d0 (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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Settings.c b/Settings.c
index 15826471..90671e65 100644
--- a/Settings.c
+++ b/Settings.c
@@ -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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy