summaryrefslogtreecommitdiffstats
path: root/CRT.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 /CRT.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 'CRT.c')
-rw-r--r--CRT.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/CRT.c b/CRT.c
index 96bc1566..17a3e12c 100644
--- a/CRT.c
+++ b/CRT.c
@@ -74,6 +74,23 @@ const char* const* CRT_treeStr = CRT_treeStrAscii;
int CRT_delay;
+const char* CRT_degreeSign;
+
+static const char* initDegreeSign(void) {
+#ifdef HAVE_LIBNCURSESW
+ if (CRT_utf8)
+ return "\xc2\xb0";
+#endif
+
+ static char buffer[4];
+ // this might fail if the current locale does not support wide characters
+ int r = snprintf(buffer, sizeof(buffer), "%lc", 176);
+ if (r > 0)
+ return buffer;
+
+ return "";
+}
+
const int* CRT_colors;
int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
@@ -718,6 +735,8 @@ void CRT_init(int delay, int colorScheme, bool allowUnicode) {
if (CRT_pageSize == -1)
CRT_fatalError("Fatal error: Can not get PAGE_SIZE by sysconf(_SC_PAGESIZE)");
CRT_pageSizeKB = CRT_pageSize / 1024;
+
+ CRT_degreeSign = initDegreeSign();
}
void CRT_done() {

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