From 1b225cd7a0af03a6349c48326118a287fc36acd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 10 Sep 2020 19:56:33 +0200 Subject: Show CPU temperature in CPU meter Show the CPU temperature in the CPU meter, like CPU frequency, instead of using an extra Meter. --- Settings.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Settings.c') 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; -- cgit v1.2.3