diff options
author | DX37 | 2020-09-05 12:47:54 +0700 |
---|---|---|
committer | DX37 | 2020-09-05 12:47:54 +0700 |
commit | 78260f9863fb90ca1efe9f8878738b2fa535e8b1 (patch) | |
tree | 723df774ca083f066f495e1b3b9e6640ad97806e | |
parent | 46fd0e2d971b4eb4634371009214826cc0980136 (diff) | |
download | aur-78260f9863fb90ca1efe9f8878738b2fa535e8b1.tar.gz |
fixes
- apply some fixes to temperature patch
- add myself as contributor
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | htop-temperature-rpi.patch | 18 |
3 files changed, 14 insertions, 12 deletions
@@ -1,7 +1,7 @@ pkgbase = htop-temperature-rpi pkgdesc = Interactive process viewer with added support for CPU temperature. Version for gathering Raspberry Pi CPU temperature from thermal_zone0 pkgver = 3.0.1 - pkgrel = 2 + pkgrel = 3 url = https://htop.dev/ arch = i686 arch = x86_64 @@ -18,7 +18,7 @@ pkgbase = htop-temperature-rpi source = https://github.com/htop-dev/htop/archive/3.0.1/htop-3.0.1.tar.gz source = htop-temperature-rpi.patch sha256sums = 8465164bc085f5f1813e1d3f6c4b9b56bf4c95cc12226a5367e65794949b01ca - sha256sums = aabf604ab3cf1094df1f7d5e375f2d796b8f631e169b48cd3fac63f8b2ae2a4d + sha256sums = 0dab0800730e8d57d4b0d202a36075cf4fee36cb799d2c802bd1b2815a227373 pkgname = htop-temperature-rpi @@ -3,7 +3,7 @@ _pkgname=htop pkgname=htop-temperature-rpi pkgver=3.0.1 -pkgrel=2 +pkgrel=3 pkgdesc='Interactive process viewer with added support for CPU temperature. Version for gathering Raspberry Pi CPU temperature from thermal_zone0' arch=('i686' 'x86_64' 'aarch64' 'armv7h' 'armv6h') url='https://htop.dev/' @@ -15,7 +15,7 @@ options=('!emptydirs') source=("https://github.com/htop-dev/htop/archive/${pkgver}/${_pkgname}-${pkgver}.tar.gz" 'htop-temperature-rpi.patch') sha256sums=('8465164bc085f5f1813e1d3f6c4b9b56bf4c95cc12226a5367e65794949b01ca' - 'aabf604ab3cf1094df1f7d5e375f2d796b8f631e169b48cd3fac63f8b2ae2a4d') + '0dab0800730e8d57d4b0d202a36075cf4fee36cb799d2c802bd1b2815a227373') prepare() { cd "$_pkgname-$pkgver" diff --git a/htop-temperature-rpi.patch b/htop-temperature-rpi.patch index 80f4be1025b7..f1660edb952e 100644 --- a/htop-temperature-rpi.patch +++ b/htop-temperature-rpi.patch @@ -112,11 +112,12 @@ new file mode 100644 index 0000000..18b198d --- /dev/null +++ b/TemperatureMeter.c -@@ -0,0 +1,87 @@ +@@ -0,0 +1,88 @@ +/* +htop - TemperatureMeter.c +(C) 2013 Ralf Stemmer +(C) 2014 Blair Bonnett ++(C) 2020 Maxim Kurnosenko +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ @@ -162,7 +163,7 @@ index 0000000..18b198d + int read; + size_t len; + char *line = NULL; -+ int temperature; ++ long temperature; + while ((read = getline(&line, &len, p)) != -1) { + // convert the string into an integer, this is necessary for further steps + temperature = strtol(line, NULL, 10); @@ -171,13 +172,13 @@ index 0000000..18b198d + + // choose the color for the temperature + int tempColor; -+ if (temperature < 60) tempColor = coolColor; -+ else if (temperature >= 60 && temperature < 70) tempColor = mediumColor; -+ else tempColor = hotColor; ++ if (temperature < 60) tempColor = coolColor; ++ else if (temperature < 70) tempColor = mediumColor; ++ else tempColor = hotColor; + + // output the temperature -+ char buffer[20]; -+ sprintf(buffer, "%d", temperature); ++ char buffer[30]; ++ sprintf(buffer, "%ld", temperature); + RichString_append(out, tempColor, buffer); + RichString_append(out, textColor, "°C "); + } @@ -205,7 +206,7 @@ new file mode 100644 index 0000000..b86ddd8 --- /dev/null +++ b/TemperatureMeter.h -@@ -0,0 +1,19 @@ +@@ -0,0 +1,20 @@ +/* Do not edit this file. It was automatically generated. */ + +#ifndef HEADER_TemperatureMeter @@ -214,6 +215,7 @@ index 0000000..b86ddd8 +htop - TemperatureMeter.h +(C) 2013 Ralf Stemmer +(C) 2014 Blair Bonnett ++(C) 2020 Maxim Kurnosenko +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ |