[arch-commits] Commit in icewm/trunk (PKGBUILD icewm-cpustatus.patch)
Eric Bélanger
eric at archlinux.org
Tue May 29 22:00:52 UTC 2012
Date: Tuesday, May 29, 2012 @ 18:00:51
Author: eric
Revision: 160074
upgpkg: icewm 1.3.7-3
Fix temperature info in tooltip (close FS#30058)
Added:
icewm/trunk/icewm-cpustatus.patch
Modified:
icewm/trunk/PKGBUILD
-----------------------+
PKGBUILD | 9 ++++++---
icewm-cpustatus.patch | 45 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2012-05-29 21:54:02 UTC (rev 160073)
+++ PKGBUILD 2012-05-29 22:00:51 UTC (rev 160074)
@@ -3,7 +3,7 @@
pkgname=icewm
pkgver=1.3.7
-pkgrel=2
+pkgrel=3
pkgdesc="A Window Manager designed for speed, usability, and consistency"
arch=('i686' 'x86_64')
url="http://www.icewm.org/"
@@ -11,12 +11,14 @@
depends=('libxrandr' 'libxft' 'libsm' 'libxinerama' 'gdk-pixbuf2')
makedepends=('xorg-mkfontdir')
source=(http://downloads.sourceforge.net/sourceforge/icewm/${pkgname}-${pkgver}.tar.gz
- use_ICEWM_deprecated.patch ignore_workarea_hints.patch no_proc_acpi.patch wmclient.patch)
+ use_ICEWM_deprecated.patch ignore_workarea_hints.patch no_proc_acpi.patch
+ wmclient.patch icewm-cpustatus.patch)
sha1sums=('ce8d86190e275dc7db2d8c28472a579264120803'
'ac8f352ba5ee33e19ce75fdeed890361550e125a'
'49ca37ae41290f17a71a177b1f774235f91d79f1'
'a47fb4191f30b8f42a6bd90ca5d7941bb3d65338'
- 'd16b4b3ab269a657e735e343833973d000c0b35b')
+ 'd16b4b3ab269a657e735e343833973d000c0b35b'
+ '0f4a02153496dadd26742f6bd3bdc166d7eafaed')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
@@ -24,6 +26,7 @@
patch -p1 -i "${srcdir}/ignore_workarea_hints.patch"
patch -p1 -i "${srcdir}/no_proc_acpi.patch"
patch -p1 -i "${srcdir}/wmclient.patch"
+ patch -p2 -i "${srcdir}/icewm-cpustatus.patch"
LIBS+="-lfontconfig" ./configure --prefix=/usr --sysconfdir=/etc \
--enable-shaped-decorations --enable-gradients
make
Added: icewm-cpustatus.patch
===================================================================
--- icewm-cpustatus.patch (rev 0)
+++ icewm-cpustatus.patch 2012-05-29 22:00:51 UTC (rev 160074)
@@ -0,0 +1,45 @@
+ icewm/src/acpustatus.cc | 31 +++++++++++++++++++++++++++++++
+ 1 files changed, 31 insertions(+), 0 deletions(-)
+
+diff --git a/icewm/src/acpustatus.cc b/icewm/src/acpustatus.cc
+index 5e959d6..b9e5450 100644
+--- a/icewm/src/acpustatus.cc
++++ b/icewm/src/acpustatus.cc
+@@ -315,6 +315,37 @@ int CPUStatus::getAcpiTemp(char *tempbuf, int buflen) {
+ }
+ closedir(dir);
+ }
++ else if ((dir = opendir("/sys/class/thermal")) != NULL) {
++ struct dirent *de;
++
++ while ((de = readdir(dir)) != NULL) {
++
++ int fd, seglen;
++
++ if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
++ continue;
++
++ sprintf(namebuf, "/sys/class/thermal/%s/temp", de->d_name);
++ fd = open(namebuf, O_RDONLY);
++ if (fd != -1) {
++ int len = read(fd, buf, sizeof(buf) - 1);
++ buf[len - 4] = '\0';
++ seglen = strlen(buf) + 4;
++ if (retbuflen + seglen >= buflen) {
++ retbuflen = -retbuflen;
++ close(fd);
++ closedir(dir);
++ break;
++ }
++ retbuflen += seglen;
++ strcat(tempbuf, " ");
++ strncat(tempbuf, buf, seglen);
++ strcat(tempbuf, " C");
++ close(fd);
++ }
++ }
++ closedir(dir);
++ }
+ return retbuflen;
+ }
+
More information about the arch-commits
mailing list