diff options
-rw-r--r-- | sysutils/asapm/DESCR | 6 | ||||
-rw-r--r-- | sysutils/asapm/MESSAGE | 6 | ||||
-rw-r--r-- | sysutils/asapm/Makefile | 4 | ||||
-rw-r--r-- | sysutils/asapm/distinfo | 6 | ||||
-rw-r--r-- | sysutils/asapm/patches/patch-ad | 8 | ||||
-rw-r--r-- | sysutils/asapm/patches/patch-af | 38 |
6 files changed, 49 insertions, 19 deletions
diff --git a/sysutils/asapm/DESCR b/sysutils/asapm/DESCR index 2fafa36d493..eda591ad281 100644 --- a/sysutils/asapm/DESCR +++ b/sysutils/asapm/DESCR @@ -1,5 +1,7 @@ 'asapm' is an X11 client which displays a battery status of your -notebook computer equiped with APM (Advanced Power Management) BIOS. +notebook computer equiped with APM (Advanced Power Management) BIOS +or ACPI (Advanced Configuration and Power Interface). The status displayed consists remaining battery life, an AC line status, a charging status and a digital readout with (a) Percent -battery remaining and (b) estimated time to dead. +battery remaining and (b) estimated time to dead. If using ACPI this +version can also show the time left to recharge the battery. diff --git a/sysutils/asapm/MESSAGE b/sysutils/asapm/MESSAGE index 4f062510e7f..1863115b7c5 100644 --- a/sysutils/asapm/MESSAGE +++ b/sysutils/asapm/MESSAGE @@ -1,7 +1,11 @@ =========================================================================== -$NetBSD: MESSAGE,v 1.1 2001/10/31 22:52:53 zuntum Exp $ +$NetBSD: MESSAGE,v 1.2 2004/06/30 14:22:49 kivinen Exp $ This package requires that the APM driver be enabled in your kernel. See apm(4) for details. +This package has also special NetBSD modifications to work also with the +sysmon interface, which allows it also work with the ACPI driver if +installed in the kernel. + =========================================================================== diff --git a/sysutils/asapm/Makefile b/sysutils/asapm/Makefile index 46a15d062be..01e09333878 100644 --- a/sysutils/asapm/Makefile +++ b/sysutils/asapm/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.27 2004/06/09 21:00:05 kivinen Exp $ +# $NetBSD: Makefile,v 1.28 2004/06/30 14:22:49 kivinen Exp $ # DISTNAME= asapm-2.11 CATEGORIES= sysutils x11 -PKGREVISION= 1 +PKGREVISION= 2 MASTER_SITES= http://www.tigr.net/afterstep/download/asapm/ \ ftp://ftp.afterstep.org/apps/asapm/ \ ftp://fuf.sh.cvut.cz/pub/AfterStep/apps/asapm/ diff --git a/sysutils/asapm/distinfo b/sysutils/asapm/distinfo index 19868008bea..e230d354acc 100644 --- a/sysutils/asapm/distinfo +++ b/sysutils/asapm/distinfo @@ -1,10 +1,10 @@ -$NetBSD: distinfo,v 1.7 2004/06/09 22:22:09 kivinen Exp $ +$NetBSD: distinfo,v 1.8 2004/06/30 14:22:49 kivinen Exp $ SHA1 (asapm-2.11.tar.gz) = cd89c5557d76dbb19ee565435b533ab48f05f102 Size (asapm-2.11.tar.gz) = 58729 bytes SHA1 (patch-aa) = 570d2240f6afbf78d3cd72e1c1b963beb7ae074d SHA1 (patch-ab) = 8796f1f6220ecdbd23d360bb18f721e1ef83febf SHA1 (patch-ac) = edfe7deae628b9e2aa57b67666f4e7dea13c19bf -SHA1 (patch-ad) = f6a82aa2cff611f03e999a0773f8b47156b9550f +SHA1 (patch-ad) = 4b6bf84a4cf1881ef0c4e97fbe64201e3437aba1 SHA1 (patch-ae) = 28b0e4c446c466a90d4a2ae0952b2326385a8c6c -SHA1 (patch-af) = 74a344768c237505c3bd63d757fd6aeac8b46f2a +SHA1 (patch-af) = 8ae72f1cb8eb6e2d449f37dd186b0bae362c6a13 diff --git a/sysutils/asapm/patches/patch-ad b/sysutils/asapm/patches/patch-ad index 28c92493607..6d3c75f2439 100644 --- a/sysutils/asapm/patches/patch-ad +++ b/sysutils/asapm/patches/patch-ad @@ -1,13 +1,17 @@ -$NetBSD: patch-ad,v 1.1 2004/06/09 21:00:05 kivinen Exp $ +$NetBSD: patch-ad,v 1.2 2004/06/30 14:22:49 kivinen Exp $ --- state.h.orig 1999-03-09 12:35:24.000000000 +0200 +++ state.h -@@ -13,6 +13,8 @@ +@@ -13,6 +13,12 @@ /* file -> APM device */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #define APM_PROC "/dev/apm" +#include <paths.h> ++#ifdef _PATH_SYSMON +#define SYSMON_DEV _PATH_SYSMON ++#else ++#define SYSMON_DEV "/dev/sysmon" ++#endif #else #define APM_PROC "/proc/apm" #endif diff --git a/sysutils/asapm/patches/patch-af b/sysutils/asapm/patches/patch-af index 8f816971ec2..7133a819a7e 100644 --- a/sysutils/asapm/patches/patch-af +++ b/sysutils/asapm/patches/patch-af @@ -1,4 +1,4 @@ -$NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ +$NetBSD: patch-af,v 1.4 2004/06/30 14:22:49 kivinen Exp $ --- apm_read.c.orig 2001-11-23 23:07:19.000000000 +0200 +++ apm_read.c @@ -10,13 +10,21 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ #include "state.h" extern struct apm_state state; -@@ -136,18 +137,163 @@ void ReadAPMDevice( ) /* FreeBSD versio +@@ -136,18 +137,183 @@ void ReadAPMDevice( ) /* FreeBSD versio state.time_left = info.ai_batt_time / 60; } #elif defined(__NetBSD__)||defined(__OpenBSD__) + +#include <sys/envsys.h> + ++/* We cannot use ifdef ENVSYS_SWATTHOUR etc as it is enum. The ++ ENVSYS_FFRACVALID was added at the same time as WATTHOUR and INDICATOR, so ++ we use it to see if we have the support for those. */ ++#ifdef ENVSYS_FFRACVALID ++#define HAVE_ENVSYS_SWATTHOUR ++#define HAVE_ENVSYS_INDICATOR ++#endif /* ENVSYS_FFRACVALID */ ++ +int match_end(const char *str, const char *end_part) +{ + int len1, len2; @@ -33,7 +41,7 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ + int count = 0; + envsys_basic_info_t ebis; + envsys_tre_data_t etds; -+ int32_t design, charge, warn_cap, low_cap, rate; ++ int32_t design, charge, warn_cap, low_cap, discharge_rate, charge_rate; + int connected, charging, percent, time_units, battery_status; + + if ((fd = open(sysmon_device_file, O_RDONLY)) == -1) { @@ -45,7 +53,8 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ + charge = 0; + warn_cap = 0; + low_cap = 0; -+ rate = 0; ++ charge_rate = 0; ++ discharge_rate = 0; + connected = 0; + charging = 0; + percent = 0; @@ -74,6 +83,7 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ + if (!(etds.validflags & ENVSYS_FCURVALID)) + continue; + ++#ifdef HAVE_ENVSYS_SWATTHOUR + if (etds.units == ENVSYS_SWATTHOUR) { + /* Watt hours, this must be battery capacity info. */ + if (match_end(ebis.desc, " design cap")) { @@ -85,7 +95,10 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ + } else if (match_end(ebis.desc, " low cap")) { + low_cap += etds.cur.data_s; + } -+ } else if (etds.units == ENVSYS_INDICATOR) { ++ } ++#endif /* HAVE_ENVSYS_SWATTHOUR */ ++#ifdef HAVE_ENVSYS_INDICATOR ++ if (etds.units == ENVSYS_INDICATOR) { + /* Indicator of something, check for connected. */ + if (match_end(ebis.desc, " connected")) { + connected = etds.cur.data_us; @@ -93,11 +106,16 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ + charging = etds.cur.data_us; + } + -+ } else if (etds.units == ENVSYS_SWATTS) { ++ } ++#endif /* HAVE_ENVSYS_INDICATOR */ ++ if (etds.units == ENVSYS_SWATTS) { + /* Watts, this must discharge rate. */ + if (match_end(ebis.desc, " discharge rate")) { -+ rate += etds.cur.data_s; ++ discharge_rate += etds.cur.data_s; ++ } else if (match_end(ebis.desc, " charge rate")) { ++ charge_rate += etds.cur.data_s; + } ++ + } + } + @@ -144,8 +162,10 @@ $NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $ + ++state.update; + } + -+ if (rate > 0) { -+ time_units = charge / (rate / 60); ++ if (discharge_rate > 0) { ++ time_units = charge / (discharge_rate / 60); ++ } else if (charge_rate > 0 && design > 0 && charging) { ++ time_units = (design - charge) / (charge_rate / 60); + } + + /* we can display maximum 99:59 */ |