diff options
author | pooka <pooka@pkgsrc.org> | 2008-01-04 01:43:58 +0000 |
---|---|---|
committer | pooka <pooka@pkgsrc.org> | 2008-01-04 01:43:58 +0000 |
commit | ba6aefd6fec4e68fba33e5e052534baba6471435 (patch) | |
tree | 778cc25aab47df5c56d27e1287392eddf2c6ae9a /sysutils | |
parent | ce3ed076693e9755ca2a8bc2efe39ae0e062d3e3 (diff) | |
download | pkgsrc-ba6aefd6fec4e68fba33e5e052534baba6471435.tar.gz |
Make charging detection use discharge rate instead of charge rate,
since a fully charged battery would sometimes drop the charge rate
to 0. This happens at least on the submitter's and my laptops.
patch from ymous anonimo
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/xbattbar/Makefile | 4 | ||||
-rw-r--r-- | sysutils/xbattbar/distinfo | 4 | ||||
-rw-r--r-- | sysutils/xbattbar/patches/patch-ab | 22 |
3 files changed, 16 insertions, 14 deletions
diff --git a/sysutils/xbattbar/Makefile b/sysutils/xbattbar/Makefile index e78b8af68f8..9c77342767b 100644 --- a/sysutils/xbattbar/Makefile +++ b/sysutils/xbattbar/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.31 2007/11/28 22:33:17 jnemeth Exp $ +# $NetBSD: Makefile,v 1.32 2008/01/04 01:43:58 pooka Exp $ DISTNAME= xbattbar_1.4.2 PKGNAME= ${DISTNAME:S/_/-/} -PKGREVISION= 8 +PKGREVISION= 9 CATEGORIES= sysutils x11 MASTER_SITES= http://iplab.aist-nara.ac.jp/member/suguru/ diff --git a/sysutils/xbattbar/distinfo b/sysutils/xbattbar/distinfo index 5864d16946f..08f43b0bd22 100644 --- a/sysutils/xbattbar/distinfo +++ b/sysutils/xbattbar/distinfo @@ -1,8 +1,8 @@ -$NetBSD: distinfo,v 1.13 2007/11/28 22:33:17 jnemeth Exp $ +$NetBSD: distinfo,v 1.14 2008/01/04 01:43:58 pooka Exp $ SHA1 (xbattbar_1.4.2.tar.gz) = 14e9aafd62919e4a625d3f84df3b074b9eef8279 RMD160 (xbattbar_1.4.2.tar.gz) = f28a273a1865a0919e32144bbb5b16b3c0340061 Size (xbattbar_1.4.2.tar.gz) = 14079 bytes SHA1 (patch-aa) = 3bd4b688ccaeebe766335245c1a8c5dde52768c2 -SHA1 (patch-ab) = f9ad127d4d3f9c4d5c6c01b9d476f74faf665fdb +SHA1 (patch-ab) = 17def14cb44ef4374aaa0e67e5bef3f1eeb042f7 SHA1 (patch-ac) = 507cdf9b4e79dc577d020963142e262d04536527 diff --git a/sysutils/xbattbar/patches/patch-ab b/sysutils/xbattbar/patches/patch-ab index e028534381b..d016476be08 100644 --- a/sysutils/xbattbar/patches/patch-ab +++ b/sysutils/xbattbar/patches/patch-ab @@ -1,8 +1,8 @@ -$NetBSD: patch-ab,v 1.8 2007/11/28 22:33:18 jnemeth Exp $ +$NetBSD: patch-ab,v 1.9 2008/01/04 01:43:58 pooka Exp $ ---- xbattbar.c.orig 2001-02-02 00:25:29.000000000 -0500 -+++ xbattbar.c 2007-11-27 20:56:25.000000000 -0500 -@@ -27,6 +27,14 @@ +--- xbattbar.c.orig 2001-02-02 07:25:29.000000000 +0200 ++++ xbattbar.c 2008-01-04 03:32:10.000000000 +0200 +@@ -27,6 +27,16 @@ #include <sys/types.h> #include <sys/time.h> @@ -12,12 +12,14 @@ $NetBSD: patch-ab,v 1.8 2007/11/28 22:33:18 jnemeth Exp $ +#include <sys/param.h> +#include <sys/envsys.h> +#include <paths.h> ++#include <stdlib.h> ++#include <string.h> +#endif /* __NetBSD__ */ + #include <signal.h> #include <stdio.h> #include <unistd.h> -@@ -577,33 +585,177 @@ +@@ -577,33 +587,177 @@ #ifdef __NetBSD__ @@ -162,7 +164,7 @@ $NetBSD: patch-ab,v 1.8 2007/11/28 22:33:18 jnemeth Exp $ + if (acpi) { +#ifdef HAVE_NETBSD_ACPI + int32_t rtot = 0, maxtot = 0; -+ p = APM_AC_OFF; ++ p = APM_AC_ON; + for (i = 0 ; i < ns ; i++) { + if ((etds[i].validflags & ENVSYS_FCURVALID) == 0) + continue; @@ -183,11 +185,11 @@ $NetBSD: patch-ab,v 1.8 2007/11/28 22:33:18 jnemeth Exp $ + * "discharging" and vice versa, but this is the best + * compromise. + */ -+ if (ebis[i].units == ENVSYS_INDICATOR && ++ if ((ebis[i].units == ENVSYS_SWATTS || ebis[i].units == ENVSYS_SAMPS) && + etds[i].cur.data_s && + strncmp(ebis[i].desc, "acpibat", 7) == 0 && -+ strcmp(&ebis[i].desc[cc - 8], "charging") == 0) { -+ p = APM_AC_ON; ++ strcmp(&ebis[i].desc[cc - 14], "discharge rate") == 0) { ++ p = APM_AC_OFF; + } + } + r = (rtot * 100.0) / maxtot; @@ -198,7 +200,7 @@ $NetBSD: patch-ab,v 1.8 2007/11/28 22:33:18 jnemeth Exp $ if (info.battery_life > 100) { /* some APM BIOSes return values slightly > 100 */ r = 100; -@@ -617,6 +769,8 @@ +@@ -617,6 +771,8 @@ } else { p = APM_AC_OFF; } |