summaryrefslogtreecommitdiffstats
path: root/htop.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 /htop.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 'htop.c')
-rw-r--r--htop.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/htop.c b/htop.c
index b36bd4b0..c6cd5411 100644
--- a/htop.c
+++ b/htop.c
@@ -36,6 +36,10 @@ in the source distribution for its full text.
#include "XUtils.h"
+#ifdef HAVE_LIBSENSORS
+#include <sensors/sensors.h>
+#endif
+
//#link m
static void printVersionFlag(void) {
@@ -317,6 +321,10 @@ int main(int argc, char** argv) {
CRT_init(settings->delay, settings->colorScheme, flags.allowUnicode);
+#ifdef HAVE_LIBSENSORS
+ sensors_init(NULL);
+#endif
+
MainPanel* panel = MainPanel_new();
ProcessList_setPanel(pl, (Panel*) panel);
@@ -357,6 +365,10 @@ int main(int argc, char** argv) {
attroff(CRT_colors[RESET_COLOR]);
refresh();
+#ifdef HAVE_LIBSENSORS
+ sensors_cleanup();
+#endif
+
CRT_done();
if (settings->changed)
Settings_write(settings);

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