diff options
author | mycroft <mycroft> | 2003-11-01 09:25:31 +0000 |
---|---|---|
committer | mycroft <mycroft> | 2003-11-01 09:25:31 +0000 |
commit | 4c8067ae577e9fdf9a7ab70ddb5a11d2f6311e43 (patch) | |
tree | e35fb80fbd0b9c8c34d52638d0fed7449bd8a6b5 /sysutils | |
parent | b820e9dc212d167e8bc98fd1342f0f25ac2007bd (diff) | |
download | pkgsrc-4c8067ae577e9fdf9a7ab70ddb5a11d2f6311e43.tar.gz |
More ACPI-related changes:
* Recognize "charge" in addition to "energy".
* Test ENVSYS_FCURVALID.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/xbattbar/distinfo | 4 | ||||
-rw-r--r-- | sysutils/xbattbar/patches/patch-ab | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/sysutils/xbattbar/distinfo b/sysutils/xbattbar/distinfo index fbdedcda127..cd0aeb220be 100644 --- a/sysutils/xbattbar/distinfo +++ b/sysutils/xbattbar/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.6 2003/11/01 04:03:18 mrg Exp $ +$NetBSD: distinfo,v 1.7 2003/11/01 09:25:31 mycroft Exp $ SHA1 (xbattbar_1.4.2.tar.gz) = 14e9aafd62919e4a625d3f84df3b074b9eef8279 Size (xbattbar_1.4.2.tar.gz) = 14079 bytes SHA1 (patch-aa) = 3bd4b688ccaeebe766335245c1a8c5dde52768c2 -SHA1 (patch-ab) = 87b2b93952de2e8b356ee4a8288062a35463b45a +SHA1 (patch-ab) = 8199c055881cff22fdabca167a0c9d4ce764b247 diff --git a/sysutils/xbattbar/patches/patch-ab b/sysutils/xbattbar/patches/patch-ab index 8221c10bbbe..099b4fd7d99 100644 --- a/sysutils/xbattbar/patches/patch-ab +++ b/sysutils/xbattbar/patches/patch-ab @@ -1,4 +1,4 @@ -$NetBSD: patch-ab,v 1.3 2003/11/01 04:03:18 mrg Exp $ +$NetBSD: patch-ab,v 1.4 2003/11/01 09:25:31 mycroft Exp $ --- xbattbar.c.orig 2001-02-02 16:25:29.000000000 +1100 +++ xbattbar.c 2003-11-01 14:55:10.000000000 +1100 @@ -16,7 +16,7 @@ $NetBSD: patch-ab,v 1.3 2003/11/01 04:03:18 mrg Exp $ #include <signal.h> #include <stdio.h> #include <unistd.h> -@@ -583,46 +590,161 @@ +@@ -583,46 +590,165 @@ #define _PATH_APM_CTLDEV "/dev/apmctl" #define _PATH_APM_NORMAL "/dev/apm" @@ -142,18 +142,22 @@ $NetBSD: patch-ab,v 1.3 2003/11/01 04:03:18 mrg Exp $ - } + if (acpi) { + int32_t rtot = 0, maxtot = 0; -+ p = APM_AC_ON; ++ p = APM_AC_OFF; + for (i = 0 ; i < ns ; i++) { ++ if ((etds[i].validflags & ENVSYS_FCURVALID) == 0) ++ continue; + cc = strlen(ebis[i].desc); -+ if (strcmp(&ebis[i].desc[cc - 6], "energy") == 0) { ++ if (strncmp(ebis[i].desc, "acpibat", 7) == 0 && ++ (strcmp(&ebis[i].desc[cc - 7], " charge") == 0 || ++ strcmp(&ebis[i].desc[cc - 7], " energy") == 0)) { + rtot += etds[i].cur.data_s; + maxtot += etds[i].max.data_s; + } + if (ebis[i].units == ENVSYS_INDICATOR && + etds[i].cur.data_s && + strncmp(ebis[i].desc, "acpiacad", 8) == 0 && -+ strcmp(&ebis[i].desc[cc - 12], "disconnected") == 0) { -+ p = APM_AC_OFF; ++ strcmp(&ebis[i].desc[cc - 10], " connected") == 0) { ++ p = APM_AC_ON; + } + } + r = (rtot * 100.0) / maxtot; |