[arch-commits] Commit in icewm/trunk (PKGBUILD icewm-1.3.8-remain_power.patch)

Eric Bélanger eric at nymeria.archlinux.org
Tue Jun 3 20:32:04 UTC 2014


    Date: Tuesday, June 3, 2014 @ 22:32:04
  Author: eric
Revision: 214110

upgpkg: icewm 1.3.8-3

Fix remaining battery time (close FS#40613)

Added:
  icewm/trunk/icewm-1.3.8-remain_power.patch
Modified:
  icewm/trunk/PKGBUILD

--------------------------------+
 PKGBUILD                       |    9 ++++++---
 icewm-1.3.8-remain_power.patch |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-06-03 19:42:39 UTC (rev 214109)
+++ PKGBUILD	2014-06-03 20:32:04 UTC (rev 214110)
@@ -3,7 +3,7 @@
 
 pkgname=icewm
 pkgver=1.3.8
-pkgrel=2
+pkgrel=3
 pkgdesc="A Window Manager designed for speed, usability, and consistency"
 arch=('i686' 'x86_64')
 url="http://www.icewm.org/"
@@ -11,11 +11,13 @@
 depends=('libxrandr' 'libxft' 'libsm' 'libxinerama' 'gdk-pixbuf2')
 makedepends=('xorg-mkfontdir')
 source=(http://downloads.sourceforge.net/sourceforge/icewm/${pkgname}-${pkgver}.tar.gz
-        ignore_workarea_hints.patch icewm-cpustatus.patch icewm-1.3.8-shutdown-reboot-command.patch)
+        ignore_workarea_hints.patch icewm-cpustatus.patch icewm-1.3.8-shutdown-reboot-command.patch
+        icewm-1.3.8-remain_power.patch)
 sha1sums=('dc9155227129be14aced00c24c572356e0fa5cd8'
           '88b4b198827d6590901c2c8bdba8826d928f6f1a'
           '0f4a02153496dadd26742f6bd3bdc166d7eafaed'
-          'd85d35b756ca2d5283f10de9d9bca23d39c68f6f')
+          'd85d35b756ca2d5283f10de9d9bca23d39c68f6f'
+          '1c5e7361bec5f4775da86f663ecb397e711b8486')
 
 prepare() {
   cd ${pkgname}-${pkgver}
@@ -22,6 +24,7 @@
   patch -p1 -i "${srcdir}/ignore_workarea_hints.patch"
   patch -p2 -i "${srcdir}/icewm-cpustatus.patch"
   patch -p1 -i "${srcdir}/icewm-1.3.8-shutdown-reboot-command.patch"
+  patch -p1 -i "${srcdir}/icewm-1.3.8-remain_power.patch"
 }
 
 build() {

Added: icewm-1.3.8-remain_power.patch
===================================================================
--- icewm-1.3.8-remain_power.patch	                        (rev 0)
+++ icewm-1.3.8-remain_power.patch	2014-06-03 20:32:04 UTC (rev 214110)
@@ -0,0 +1,32 @@
+--- icewm-1.3.8-orig/src/aapm.cc	2013-11-17 17:54:39.000000000 +0100
++++ icewm-1.3.8/src/aapm.cc	2014-05-30 21:50:54.131868164 +0200
+@@ -614,6 +614,11 @@
+         }
+         strcat3(buf, "/sys/class/power_supply/", BATname, "/current_now", sizeof(buf));
+         fd = fopen(buf, "r");
++        if (fd == NULL) {
++        	strcat3(buf, "/sys/class/power_supply/", BATname, "/power_now", sizeof(buf));
++        	fd = fopen(buf, "r");
++	}
++
+         if (fd != NULL && fgets(buf, sizeof(buf), fd)) {
+                 //In case it contains non-numeric value
+                 if (sscanf(buf,"%d", &BATrate) <= 0) {
+@@ -697,7 +703,7 @@
+            batCount++;
+         }
+ 
+-        if (!Tool &&
++        if (Tool &&
+             taskBarShowApmTime &&
+             BATpresent == BAT_PRESENT &&
+             //bios calculates remaining time, only while discharging
+@@ -706,7 +711,7 @@
+             //did we parse the needed values successfully?
+             BATcapacity_full >= 0 && BATcapacity_remain >= 0 && BATrate > 0) {
+             BATtime_remain = (int) (60 * (double)(BATcapacity_remain) / BATrate);
+-            sprintf(bat_info, "%d:%02d", BATtime_remain / 60, BATtime_remain % 60);
++            sprintf(bat_info, "%d:%02d (%3.0f%%)", BATtime_remain / 60, BATtime_remain % 60,100 * (double)BATcapacity_remain / BATcapacity_full);
+         }
+         else if (BATpresent == BAT_PRESENT &&
+                  //did we parse the needed values successfully?




More information about the arch-commits mailing list