summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDX372017-01-25 20:04:58 +0700
committerDX372017-01-25 20:04:58 +0700
commite6a9ea7120a43bd456a836b636250f0d3c11745d (patch)
treeb3e556f940227be210cacdda745d19019f70f481
parent592096ffe1af40829072c7dd78f926464356ea94 (diff)
downloadaur-e6a9ea7120a43bd456a836b636250f0d3c11745d.tar.gz
Update to 2.0.2
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD32
-rw-r--r--htop-1.0.3-temperature.patch259
-rw-r--r--htop-2.0.2-temperature.patch258
4 files changed, 280 insertions, 283 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 92d48b65648..24fb60d8110 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,12 @@
pkgbase = htop-temperature
pkgdesc = Interactive process viewer with added support for CPU temperature
- pkgver = 1.0.3
+ pkgver = 2.0.2
pkgrel = 1
- url = http://htop.sourceforge.net/
+ url = http://hisham.hm/htop/
arch = i686
arch = x86_64
license = GPL
- makedepends = python2
+ makedepends = python
depends = ncurses
depends = lm_sensors
optdepends = lsof: show files opened by a process
@@ -14,10 +14,10 @@ pkgbase = htop-temperature
provides = htop
conflicts = htop
options = !emptydirs
- source = http://hisham.hm/htop/releases/1.0.3/htop-1.0.3.tar.gz
- source = htop-1.0.3-temperature.patch
- sha256sums = 055c57927f75847fdc222b5258b079a9542811a9dcf5421c615c7e17f55d1829
- sha256sums = 6b52b5b5c0cce04ab71d8603409927dffb77433526b08a35087eb028bab0a5cf
+ source = http://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz
+ source = htop-2.0.2-temperature.patch
+ sha256sums = 179be9dccb80cee0c5e1a1f58c8f72ce7b2328ede30fb71dcdf336539be2f487
+ sha256sums = 68a96dc51a9cb847e40ad95ecf91a80979ca377f6b947e5cc9b2ef2c7dcb333e
pkgname = htop-temperature
diff --git a/PKGBUILD b/PKGBUILD
index 92d88b1a227..910646209a4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,49 +1,47 @@
-# Maintainer: Blair Bonnett <blair.bonnett at gmail dot com>
+# Maintainer: Maxim Kurnosenko <asusx2@mail.ru>
+# Contributor: Blair Bonnett <blair.bonnett at gmail dot com>
pkgname=htop-temperature
-pkgver=1.0.3
+pkgver=2.0.2
pkgrel=1
pkgdesc="Interactive process viewer with added support for CPU temperature"
arch=('i686' 'x86_64')
-url="http://htop.sourceforge.net/"
+url="http://hisham.hm/htop/"
license=('GPL')
depends=('ncurses' 'lm_sensors')
-makedepends=('python2')
+makedepends=('python')
optdepends=('lsof: show files opened by a process'
'strace: attach to a running process')
provides=('htop')
conflicts=('htop')
options=('!emptydirs')
-source=("http://hisham.hm/htop/releases/1.0.3/htop-1.0.3.tar.gz"
- "htop-1.0.3-temperature.patch")
-sha256sums=('055c57927f75847fdc222b5258b079a9542811a9dcf5421c615c7e17f55d1829'
- '6b52b5b5c0cce04ab71d8603409927dffb77433526b08a35087eb028bab0a5cf')
+source=("http://hisham.hm/htop/releases/$pkgver/htop-$pkgver.tar.gz"
+ "htop-$pkgver-temperature.patch")
+sha256sums=('179be9dccb80cee0c5e1a1f58c8f72ce7b2328ede30fb71dcdf336539be2f487'
+ '68a96dc51a9cb847e40ad95ecf91a80979ca377f6b947e5cc9b2ef2c7dcb333e')
prepare() {
- # Standard htop package commands.
- cd "htop-1.0.3"
- sed -i 's|ncursesw/curses.h|curses.h|' RichString.[ch] configure
- sed -i 's|python|python2|' scripts/MakeHeader.py
+ cd "htop-$pkgver"
# Add CPU temperature patch.
- patch -p1 -N < ../htop-1.0.3-temperature.patch
+ patch -p1 -N < ../htop-$pkgver-temperature.patch
}
build() {
- cd "htop-1.0.3"
+ cd "htop-$pkgver"
./autogen.sh
./configure \
--prefix=/usr \
+ --sysconfdir=/etc \
--enable-unicode \
--enable-openvz \
--enable-vserver \
- --enable-cgroup \
- --enable-oom
+ --enable-cgroup
make
}
package() {
- make -C "htop-1.0.3" DESTDIR="$pkgdir" install
+ make -C "htop-$pkgver" DESTDIR="$pkgdir" install
}
diff --git a/htop-1.0.3-temperature.patch b/htop-1.0.3-temperature.patch
deleted file mode 100644
index 04fbadbd320..00000000000
--- a/htop-1.0.3-temperature.patch
+++ /dev/null
@@ -1,259 +0,0 @@
-diff -urN htop-1.0.3-orig/CRT.c htop-1.0.3/CRT.c
---- htop-1.0.3-orig/CRT.c 2014-11-04 14:10:29.500604247 +0100
-+++ htop-1.0.3/CRT.c 2014-11-04 14:11:01.916663508 +0100
-@@ -60,6 +60,9 @@
- UPTIME,
- BATTERY,
- TASKS_RUNNING,
-+ TEMPERATURE_COOL,
-+ TEMPERATURE_MEDIUM,
-+ TEMPERATURE_HOT,
- SWAP,
- PROCESS,
- PROCESS_SHADOW,
-@@ -270,6 +273,9 @@
- CRT_colors[METER_VALUE] = A_BOLD;
- CRT_colors[LED_COLOR] = A_NORMAL;
- CRT_colors[TASKS_RUNNING] = A_BOLD;
-+ CRT_colors[TEMPERATURE_COOL] = A_DIM;
-+ CRT_colors[TEMPERATURE_MEDIUM] = A_NORMAL;
-+ CRT_colors[TEMPERATURE_HOT] = A_BOLD;
- CRT_colors[PROCESS] = A_NORMAL;
- CRT_colors[PROCESS_SHADOW] = A_DIM;
- CRT_colors[PROCESS_TAG] = A_BOLD;
-@@ -333,6 +339,9 @@
- CRT_colors[METER_VALUE] = ColorPair(Black,White);
- CRT_colors[LED_COLOR] = ColorPair(Green,White);
- CRT_colors[TASKS_RUNNING] = ColorPair(Green,White);
-+ CRT_colors[TEMPERATURE_COOL] = ColorPair(Green,White);
-+ CRT_colors[TEMPERATURE_MEDIUM] = ColorPair(Yellow,White);
-+ CRT_colors[TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,White);
- CRT_colors[PROCESS] = ColorPair(Black,White);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White);
- CRT_colors[PROCESS_TAG] = ColorPair(White,Blue);
-@@ -396,6 +405,9 @@
- CRT_colors[METER_VALUE] = ColorPair(Black,Black);
- CRT_colors[LED_COLOR] = ColorPair(Green,Black);
- CRT_colors[TASKS_RUNNING] = ColorPair(Green,Black);
-+ CRT_colors[TEMPERATURE_COOL] = ColorPair(Green,Black);
-+ CRT_colors[TEMPERATURE_MEDIUM] = ColorPair(Yellow,Black);
-+ CRT_colors[TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[PROCESS] = ColorPair(Black,Black);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[PROCESS_TAG] = ColorPair(White,Blue);
-@@ -459,6 +471,9 @@
- CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[LED_COLOR] = ColorPair(Green,Blue);
- CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue);
-+ CRT_colors[TEMPERATURE_COOL] = ColorPair(Green,Blue);
-+ CRT_colors[TEMPERATURE_MEDIUM] = ColorPair(Yellow,Blue);
-+ CRT_colors[TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Blue);
- CRT_colors[PROCESS] = ColorPair(White,Blue);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue);
- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue);
-@@ -522,6 +537,9 @@
- CRT_colors[METER_VALUE] = ColorPair(Green,Black);
- CRT_colors[LED_COLOR] = ColorPair(Green,Black);
- CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
-+ CRT_colors[TEMPERATURE_COOL] = ColorPair(Cyan,Black);
-+ CRT_colors[TEMPERATURE_MEDIUM] = ColorPair(Yellow,Black);
-+ CRT_colors[TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[PROCESS] = ColorPair(Cyan,Black);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
-@@ -586,6 +604,9 @@
- CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[LED_COLOR] = ColorPair(Green,Black);
- CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
-+ CRT_colors[TEMPERATURE_COOL] = A_BOLD | ColorPair(Green,Black);
-+ CRT_colors[TEMPERATURE_MEDIUM] = A_BOLD | ColorPair(Yellow,Black);
-+ CRT_colors[TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[PROCESS] = A_NORMAL;
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
-diff -urN htop-1.0.3-orig/Header.c htop-1.0.3/Header.c
---- htop-1.0.3-orig/Header.c 2014-11-04 14:10:29.496604239 +0100
-+++ htop-1.0.3/Header.c 2014-11-04 14:11:01.916663508 +0100
-@@ -12,6 +12,7 @@
- #include "MemoryMeter.h"
- #include "SwapMeter.h"
- #include "TasksMeter.h"
-+#include "TemperatureMeter.h"
- #include "LoadAverageMeter.h"
- #include "UptimeMeter.h"
- #include "BatteryMeter.h"
-@@ -150,6 +151,7 @@
- }
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(MemoryMeter)));
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(SwapMeter)));
-+ Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(TemperatureMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(TasksMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(LoadAverageMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(UptimeMeter)));
-diff -urN htop-1.0.3-orig/Makefile.am htop-1.0.3/Makefile.am
---- htop-1.0.3-orig/Makefile.am 2014-11-04 14:10:29.499604245 +0100
-+++ htop-1.0.3/Makefile.am 2014-11-04 14:12:23.748812438 +0100
-@@ -20,7 +20,7 @@
- BatteryMeter.c Process.c ProcessList.c RichString.c ScreenManager.c Settings.c \
- IOPriorityPanel.c SignalsPanel.c String.c SwapMeter.c TasksMeter.c TraceScreen.c \
- UptimeMeter.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \
--HostnameMeter.c OpenFilesScreen.c Affinity.c IOPriority.c IncSet.c
-+HostnameMeter.c OpenFilesScreen.c Affinity.c IOPriority.c TemperatureMeter.c IncSet.c
-
- myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \
- CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \
-@@ -29,7 +29,7 @@
- BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \
- ScreenManager.h Settings.h SignalsPanel.h String.h SwapMeter.h TasksMeter.h \
- TraceScreen.h UptimeMeter.h UsersTable.h Vector.h Process.h AffinityPanel.h \
--HostnameMeter.h OpenFilesScreen.h Affinity.h IOPriority.h IncSet.h
-+HostnameMeter.h OpenFilesScreen.h Affinity.h IOPriority.h TemperatureMeter.h
-
- SUFFIXES = .h
-
-diff -urN htop-1.0.3-orig/Meter.c htop-1.0.3/Meter.c
---- htop-1.0.3-orig/Meter.c 2014-11-04 14:10:29.499604245 +0100
-+++ htop-1.0.3/Meter.c 2014-11-04 14:11:01.917663509 +0100
-@@ -11,6 +11,7 @@
- #include "MemoryMeter.h"
- #include "SwapMeter.h"
- #include "TasksMeter.h"
-+#include "TemperatureMeter.h"
- #include "LoadAverageMeter.h"
- #include "UptimeMeter.h"
- #include "BatteryMeter.h"
-@@ -134,6 +135,7 @@
- &MemoryMeter_class,
- &SwapMeter_class,
- &TasksMeter_class,
-+ &TemperatureMeter_class,
- &UptimeMeter_class,
- &BatteryMeter_class,
- &HostnameMeter_class,
-diff -urN htop-1.0.3-orig/TemperatureMeter.c htop-1.0.3/TemperatureMeter.c
---- htop-1.0.3-orig/TemperatureMeter.c 1970-01-01 01:00:00.000000000 +0100
-+++ htop-1.0.3/TemperatureMeter.c 2014-11-04 14:11:01.917663509 +0100
-@@ -0,0 +1,100 @@
-+/*
-+htop - TemperatureMeter.c
-+(C) 2013 Ralf Stemmer
-+(C) 2014 Blair Bonnett
-+Released under the GNU GPL, see the COPYING file
-+in the source distribution for its full text.
-+*/
-+
-+#include "TemperatureMeter.h"
-+
-+#include "ProcessList.h"
-+#include "CRT.h"
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <limits.h>
-+
-+/*{
-+#include "Meter.h"
-+}*/
-+
-+int TemperatureMeter_attributes[] = {
-+ TEMPERATURE_COOL,
-+ TEMPERATURE_MEDIUM,
-+ TEMPERATURE_HOT,
-+};
-+
-+static void TemperatureMeter_setValues(Meter* this, char* buffer, int len) {
-+ ProcessList* pl = this->pl;
-+ this->total = pl->totalTasks;
-+ this->values[0] = pl->runningTasks;
-+ snprintf(buffer, len, "%d/%d", (int) this->values[0], (int) this->total);
-+}
-+
-+static void TemperatureMeter_display(Object* cast, RichString* out) {
-+ FILE *p;
-+ p = popen("sensors", "r");
-+ if(p == NULL) return 1;
-+
-+ int textColor = CRT_colors[METER_TEXT];
-+ int coolColor = CRT_colors[TEMPERATURE_COOL];
-+ int mediumColor = CRT_colors[TEMPERATURE_MEDIUM];
-+ int hotColor = CRT_colors[TEMPERATURE_HOT];
-+
-+ size_t read, len;
-+ char *line = NULL;
-+ char *entry = NULL;
-+ char *tstart = NULL, *tend = NULL;
-+ int temperature;
-+ while ((read = getline(&line, &len, p)) != -1) {
-+ // contains this line a core-temperature?
-+ entry = strstr(line, "Core ");
-+ if (entry == NULL) continue;
-+
-+ // find the begin of the temperature value
-+ tstart = strchr(entry, '+'); // no negative temperatures expected :)
-+ if (tstart == NULL) continue;
-+ tstart++; // jump over the '+'
-+
-+ // find the end of the temperature. Remember, it can be above 99°C ;)
-+ tend = strchr(tstart, '.'); // just the integer
-+ if (tend == NULL) continue;
-+
-+ // convert the string into an integer, this is necessary for further steps
-+ temperature = strtol(tstart, &tend, 10);
-+ if (temperature == LONG_MAX || temperature == LONG_MIN) continue;
-+ if (tstart == tend) continue;
-+
-+ // choose the color for the temperature
-+ int tempColor;
-+ if (temperature < 80) tempColor = coolColor;
-+ else if (temperature >= 80 && temperature < 90) tempColor = mediumColor;
-+ else tempColor = hotColor;
-+
-+ // output the temperature
-+ char buffer[20];
-+ sprintf(buffer, "%d", temperature);
-+ RichString_append(out, tempColor, buffer);
-+ RichString_append(out, textColor, "°C ");
-+ }
-+
-+ free(line);
-+ pclose(p);
-+}
-+
-+MeterClass TemperatureMeter_class = {
-+ .super = {
-+ .extends = Class(Meter),
-+ .display = TemperatureMeter_display,
-+ .delete = Meter_delete,
-+ },
-+ .setValues = TemperatureMeter_setValues,
-+ .defaultMode = TEXT_METERMODE,
-+ .total = 100.0,
-+ .attributes = TemperatureMeter_attributes,
-+ .name = "Temperature",
-+ .uiName = "Temperature Sensors",
-+ .caption = "Temperature: "
-+};
-diff -urN htop-1.0.3-orig/TemperatureMeter.h htop-1.0.3/TemperatureMeter.h
---- htop-1.0.3-orig/TemperatureMeter.h 1970-01-01 01:00:00.000000000 +0100
-+++ htop-1.0.3/TemperatureMeter.h 2014-11-04 14:11:01.917663509 +0100
-@@ -0,0 +1,19 @@
-+/* Do not edit this file. It was automatically generated. */
-+
-+#ifndef HEADER_TemperatureMeter
-+#define HEADER_TemperatureMeter
-+/*
-+htop - TemperatureMeter.h
-+(C) 2013 Ralf Stemmer
-+(C) 2014 Blair Bonnett
-+Released under the GNU GPL, see the COPYING file
-+in the source distribution for its full text.
-+*/
-+
-+#include "Meter.h"
-+
-+extern int TemperatureMeter_attributes[];
-+
-+extern MeterClass TemperatureMeter_class;
-+
-+#endif
diff --git a/htop-2.0.2-temperature.patch b/htop-2.0.2-temperature.patch
new file mode 100644
index 00000000000..1c5dd870898
--- /dev/null
+++ b/htop-2.0.2-temperature.patch
@@ -0,0 +1,258 @@
+diff --git a/CRT.c b/CRT.c
+index 0d51698..4eab74d 100644
+--- a/CRT.c
++++ b/CRT.c
+@@ -78,6 +78,9 @@ typedef enum ColorElements_ {
+ UPTIME,
+ BATTERY,
+ TASKS_RUNNING,
++ TEMPERATURE_COOL,
++ TEMPERATURE_MEDIUM,
++ TEMPERATURE_HOT,
+ SWAP,
+ PROCESS,
+ PROCESS_SHADOW,
+@@ -182,6 +185,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [METER_VALUE] = A_BOLD | ColorPair(Cyan,Black),
+ [LED_COLOR] = ColorPair(Green,Black),
+ [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
++ [TEMPERATURE_COOL] = A_DIM | ColorPair(Green,Black),
++ [TEMPERATURE_MEDIUM] = A_NORMAL | ColorPair(Yellow,Black),
++ [TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Black),
+ [PROCESS] = A_NORMAL,
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black),
+@@ -241,6 +247,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [METER_VALUE] = A_BOLD,
+ [LED_COLOR] = A_NORMAL,
+ [TASKS_RUNNING] = A_BOLD,
++ [TEMPERATURE_COOL] = A_DIM,
++ [TEMPERATURE_MEDIUM] = A_NORMAL,
++ [TEMPERATURE_HOT] = A_BOLD,
+ [PROCESS] = A_NORMAL,
+ [PROCESS_SHADOW] = A_DIM,
+ [PROCESS_TAG] = A_BOLD,
+@@ -300,6 +309,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [METER_VALUE] = ColorPair(Black,White),
+ [LED_COLOR] = ColorPair(Green,White),
+ [TASKS_RUNNING] = ColorPair(Green,White),
++ [TEMPERATURE_COOL] = ColorPair(Green,White),
++ [TEMPERATURE_MEDIUM] = ColorPair(Yellow,White),
++ [TEMPERATURE_HOT] = ColorPair(Red,White),
+ [PROCESS] = ColorPair(Black,White),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White),
+ [PROCESS_TAG] = ColorPair(White,Blue),
+@@ -359,6 +371,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [METER_VALUE] = ColorPair(Black,Black),
+ [LED_COLOR] = ColorPair(Green,Black),
+ [TASKS_RUNNING] = ColorPair(Green,Black),
++ [TEMPERATURE_COOL] = ColorPair(Green,Black),
++ [TEMPERATURE_MEDIUM] = ColorPair(Yellow,Black),
++ [TEMPERATURE_HOT] = ColorPair(Red,Black),
+ [PROCESS] = ColorPair(Black,Black),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [PROCESS_TAG] = ColorPair(White,Blue),
+@@ -418,6 +433,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue),
+ [LED_COLOR] = ColorPair(Green,Blue),
+ [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue),
++ [TEMPERATURE_COOL] = A_DIM | ColorPair(Green,Blue),
++ [TEMPERATURE_MEDIUM] = A_NORMAL | ColorPair(Yellow,Blue),
++ [TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Blue),
+ [PROCESS] = ColorPair(White,Blue),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue),
+ [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue),
+@@ -477,6 +495,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [METER_VALUE] = ColorPair(Green,Black),
+ [LED_COLOR] = ColorPair(Green,Black),
+ [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
++ [TEMPERATURE_COOL] = A_DIM | ColorPair(Green,Black),
++ [TEMPERATURE_MEDIUM] = A_NORMAL | ColorPair(Yellow,Black),
++ [TEMPERATURE_HOT] = A_BOLD | ColorPair(Red,Black),
+ [PROCESS] = ColorPair(Cyan,Black),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black),
+diff --git a/CRT.h b/CRT.h
+index fb82413..bda5318 100644
+--- a/CRT.h
++++ b/CRT.h
+@@ -68,6 +68,9 @@ typedef enum ColorElements_ {
+ UPTIME,
+ BATTERY,
+ TASKS_RUNNING,
++ TEMPERATURE_COOL,
++ TEMPERATURE_MEDIUM,
++ TEMPERATURE_HOT,
+ SWAP,
+ PROCESS,
+ PROCESS_SHADOW,
+diff --git a/Makefile.am b/Makefile.am
+index 19c9eb4..3398b9b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -37,12 +37,12 @@ AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \
+ EnvScreen.h InfoScreen.h XAlloc.h
+
+ if HTOP_LINUX
+ htop_CFLAGS += -rdynamic
+ myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
+-linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c
++linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c TemperatureMeter.c
+
+ myhtopplatheaders = linux/Platform.h linux/IOPriorityPanel.h linux/IOPriority.h \
+-linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h
++linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h TemperatureMeter.h
+ endif
+
+ if HTOP_FREEBSD
+diff --git a/TemperatureMeter.c b/TemperatureMeter.c
+new file mode 100644
+index 0000000..9ee9185
+--- /dev/null
++++ b/TemperatureMeter.c
+@@ -0,0 +1,100 @@
++/*
++htop - TemperatureMeter.c
++(C) 2013 Ralf Stemmer
++(C) 2014 Blair Bonnett
++Released under the GNU GPL, see the COPYING file
++in the source distribution for its full text.
++*/
++
++#include "TemperatureMeter.h"
++
++#include "ProcessList.h"
++#include "CRT.h"
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <limits.h>
++
++/*{
++#include "Meter.h"
++}*/
++
++int TemperatureMeter_attributes[] = {
++ TEMPERATURE_COOL,
++ TEMPERATURE_MEDIUM,
++ TEMPERATURE_HOT,
++};
++
++static void TemperatureMeter_setValues(Meter* this, char* buffer, int len) {
++ ProcessList* pl = this->pl;
++ this->total = pl->totalTasks;
++ this->values[0] = pl->runningTasks;
++ snprintf(buffer, len, "%d/%d", (int) this->values[0], (int) this->total);
++}
++
++static void TemperatureMeter_display(Object* cast, RichString* out) {
++ FILE *p;
++ p = popen("sensors", "r");
++ if(p == NULL) return 1;
++
++ int textColor = CRT_colors[METER_TEXT];
++ int coolColor = CRT_colors[TEMPERATURE_COOL];
++ int mediumColor = CRT_colors[TEMPERATURE_MEDIUM];
++ int hotColor = CRT_colors[TEMPERATURE_HOT];
++
++ size_t read, len;
++ char *line = NULL;
++ char *entry = NULL;
++ char *tstart = NULL, *tend = NULL;
++ int temperature;
++ while ((read = getline(&line, &len, p)) != -1) {
++ // contains this line a core-temperature?
++ entry = strstr(line, "Core ");
++ if (entry == NULL) continue;
++
++ // find the begin of the temperature value
++ tstart = strchr(entry, '+'); // no negative temperatures expected :)
++ if (tstart == NULL) continue;
++ tstart++; // jump over the '+'
++
++ // find the end of the temperature. Remember, it can be above 99°C ;)
++ tend = strchr(tstart, '.'); // just the integer
++ if (tend == NULL) continue;
++
++ // convert the string into an integer, this is necessary for further steps
++ temperature = strtol(tstart, &tend, 10);
++ if (temperature == LONG_MAX || temperature == LONG_MIN) continue;
++ if (tstart == tend) continue;
++
++ // choose the color for the temperature
++ int tempColor;
++ if (temperature < 60) tempColor = coolColor;
++ else if (temperature >= 60 && temperature < 70) tempColor = mediumColor;
++ else tempColor = hotColor;
++
++ // output the temperature
++ char buffer[20];
++ sprintf(buffer, "%d", temperature);
++ RichString_append(out, tempColor, buffer);
++ RichString_append(out, textColor, "°C ");
++ }
++
++ free(line);
++ pclose(p);
++}
++
++MeterClass TemperatureMeter_class = {
++ .super = {
++ .extends = Class(Meter),
++ .display = TemperatureMeter_display,
++ .delete = Meter_delete,
++ },
++ .updateValues = TemperatureMeter_setValues,
++ .defaultMode = TEXT_METERMODE,
++ .total = 100.0,
++ .attributes = TemperatureMeter_attributes,
++ .name = "Temperature",
++ .uiName = "Temperature Sensors",
++ .caption = "Temperature: "
++};
+diff --git a/TemperatureMeter.h b/TemperatureMeter.h
+new file mode 100644
+index 0000000..b86ddd8
+--- /dev/null
++++ b/TemperatureMeter.h
+@@ -0,0 +1,19 @@
++/* Do not edit this file. It was automatically generated. */
++
++#ifndef HEADER_TemperatureMeter
++#define HEADER_TemperatureMeter
++/*
++htop - TemperatureMeter.h
++(C) 2013 Ralf Stemmer
++(C) 2014 Blair Bonnett
++Released under the GNU GPL, see the COPYING file
++in the source distribution for its full text.
++*/
++
++#include "Meter.h"
++
++extern int TemperatureMeter_attributes[];
++
++extern MeterClass TemperatureMeter_class;
++
++#endif
+diff --git a/linux/Platform.c b/linux/Platform.c
+index de7bb84..a8e8a6f 100644
+--- a/linux/Platform.c
++++ b/linux/Platform.c
+@@ -22,6 +22,7 @@ in the source distribution for its full text.
+ #include "ClockMeter.h"
+ #include "HostnameMeter.h"
+ #include "LinuxProcess.h"
++#include "TemperatureMeter.h"
+
+ #include <math.h>
+ #include <assert.h>
+@@ -116,6 +117,7 @@ MeterClass* Platform_meterTypes[] = {
+ &MemoryMeter_class,
+ &SwapMeter_class,
+ &TasksMeter_class,
++ &TemperatureMeter_class,
+ &UptimeMeter_class,
+ &BatteryMeter_class,
+ &HostnameMeter_class,