[Pkg-wmaker-commits] [wmacpi] 06/105: wmacpi: Bump to wmacpi-ng version 0.92.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Tue Aug 18 01:13:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmacpi.
commit 0329d7aa8be239ecee156ce7c77f653aa06d633b
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Mon Aug 18 17:56:12 2014 -0500
wmacpi: Bump to wmacpi-ng version 0.92.
Source obtained from http://sourceforge.net/projects/wmacpi/files/.
2003 September 23 0.92
Fix a few more bugs, and include an option to allow the user to
specify how often to sample the ACPI data - some BIOSes disable
all interrupts while reading from the battery, which apparently
causes some interactivity issues. I have no idea why reading once
every three seconds (which is our default), but there've been some
complaints.
---
ChangeLog | 14 ++++++++++++++
acpi-ng.c | 17 +++++++----------
debian/changelog | 12 ++++++++++++
debian/wmacpi-ng.1 | 15 ++++++++++++---
wmacpi-ng.c | 39 ++++++++++++++++++++++++++++++++++++---
5 files changed, 81 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 78bf8bc..009feb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2003 September 23 0.92
+ Fix a few more bugs, and include an option to allow the user to
+ specify how often to sample the ACPI data - some BIOSes disable
+ all interrupts while reading from the battery, which apparently
+ causes some interactivity issues. I have no idea why reading once
+ every three seconds (which is our default), but there've been some
+ complaints.
+
+ Also fixed acpi-ng to properly handle the -a option.
+
+2003 August 6 0.91
+ Fix a problem I'm seeing with docking the app - if the window name
+ is set to "acpi" rather than "apm" it doesn't dock . . .
+
2003 July 16 0.90
Make the time display show '--:--' instead of '00:00' when the
time remaining is 0 - I think this is reasonable, since it'll only
diff --git a/acpi-ng.c b/acpi-ng.c
index 5b5a4eb..3341dbf 100644
--- a/acpi-ng.c
+++ b/acpi-ng.c
@@ -34,7 +34,7 @@ void usage(char *name)
{
printf("%s: query battery status on ACPI enabled systems.\n"
"Usage:\n"
- "%s [-h] [-a]\n"
+ "%s [-h] [-a samples]\n"
" h - display this help information\n"
" a - average remaining time over some number of samples\n"
" much more accurate than using a single sample\n"
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
battery_t *binfo;
adapter_t *ap;
- while((ch = getopt(argc, argv, "hvVa::")) != EOF) {
+ while((ch = getopt(argc, argv, "hvVa:")) != EOF) {
switch(ch) {
case 'h':
usage(argv[0]);
@@ -68,16 +68,12 @@ int main(int argc, char *argv[])
print_version();
return 0;
case 'a':
- printf("case a\n");
- if(optarg == NULL) {
- printf("empty optarg\n");
- } else {
- printf("optarg: %s\n", optarg);
+ if(optarg != NULL) {
samples = atoi(optarg);
+ if(samples > 1000 || samples <= 0) {
+ printf("Please specify a reasonable number of samples\n");
+ exit(1);
}
- if(samples > 1000 || samples <= 0) {
- printf("Please specify a reasonable number of samples\n");
- exit(1);
}
printf("samples: %d\n", samples);
sleep_time = 1000000/samples;
@@ -106,6 +102,7 @@ int main(int argc, char *argv[])
binfo = &batteries[i];
if(binfo->present && (binfo->charge_state == CHARGE)) {
printf("; Battery %s charging", binfo->name);
+ printf(", currently at %2d%%", binfo->percentage);
if(binfo->charge_time >= 0)
printf(", %2d:%02d remaining",
binfo->charge_time/60,
diff --git a/debian/changelog b/debian/changelog
index 2361cf4..dfe30c8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+wmacpi-ng (0.92-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Simon Fowler <simon at dreamcraft.com.au> Tue, 23 Sep 2003 11:57:09 +1000
+
+wmacpi-ng (0.91-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Simon Fowler <simon at dreamcraft.com.au> Wed, 6 Aug 2003 18:32:11 +1000
+
wmacpi-ng (0.90-1) unstable; urgency=low
* New upstream version.
diff --git a/debian/wmacpi-ng.1 b/debian/wmacpi-ng.1
index 9744b6d..ae564b4 100644
--- a/debian/wmacpi-ng.1
+++ b/debian/wmacpi-ng.1
@@ -18,6 +18,9 @@ display ]
.RI -m
battery no ]
[
+.RI -s
+sample rate ]
+[
.RI -v
]
]
@@ -73,18 +76,24 @@ battery to reach full charge if the batteries are charging.
.B \-b
Make noise when battery is critical low (beep).
.TP
-.B \-c value
+.B \-c percentage
Set critical low alarm at <value>% (default: 10%).
.TP
-.B \-d
+.B \-d display
Set the X display to open the window on.
.TP
-.B \-m
+.B \-m battery number
Set the battery to monitor initially.
.TP
+.B \-s sample rate
+Set the rate at which to sample the ACPI data (default is 100, which
+translates to once every three seconds. 10 gives once every 30 seconds,
+1 once every 300 seconds (five minutes), 1000 once every 0.3 seconds).
+.TP
.B \-n
Disable blinking power glyph when charging. Note that it still blinks when
the battery reports its capacity state as critical.
+.TP
.B \-v
Increase the verbosity of the program. Can be used more than once -
each successive use increases the verbosity.
diff --git a/wmacpi-ng.c b/wmacpi-ng.c
index a369058..3caf2a5 100644
--- a/wmacpi-ng.c
+++ b/wmacpi-ng.c
@@ -618,6 +618,7 @@ int main(int argc, char **argv)
char *display = NULL;
char ch;
int update = 0;
+ int samplerate = 100;
battery_t *binfo;
dockapp = calloc(1, sizeof(Dockapp));
@@ -633,7 +634,7 @@ int main(int argc, char **argv)
exit(1);
/* parse command-line options */
- while ((ch = getopt(argc, argv, "bd:c:m:hnvV")) != EOF) {
+ while ((ch = getopt(argc, argv, "bd:c:m:s:hnvV")) != EOF) {
switch (ch) {
case 'b':
noisy_critical = 1;
@@ -668,6 +669,16 @@ int main(int argc, char **argv)
fprintf(stderr, "Monitoring battery %d\n", battery_no);
}
break;
+ case 's':
+ if (optarg) {
+ samplerate = atoi(optarg);
+ if (samplerate == 0) samplerate = 1;
+ if (samplerate > 3000) samplerate = 3000;
+ } else {
+ usage(argv[0]);
+ exit(1);
+ }
+ break;
case 'h':
usage(argv[0]);
return 0;
@@ -693,7 +704,10 @@ int main(int argc, char **argv)
exit(1);
/* make new dockapp window */
- new_window("acpi");
+ /* Don't even /think/ of asking me why, but if I set the window name to
+ * "acpi", the app refuses to dock properly - it's just plain /weird/ */
+/* new_window("acpi"); */
+ new_window("apm");
/* get initial statistics */
acquire_all_info();
@@ -736,7 +750,26 @@ int main(int argc, char **argv)
}
}
- if (update++ == 30) {
+ /* XXX: some laptops have problems with sampling the battery
+ * regularly - apparently, the BIOS disables interrupts while
+ * reading from the battery, which is generally on a slow bus
+ * and is a slow device, so you get significant periods without
+ * interrupts. This causes interactivity to suffer . . .
+ *
+ * My proposed workaround is to allow the user to set the sample
+ * rate - it defaults to ten, but can be set lower (or higher).
+ *
+ * The only problem with this is that we need to sample less
+ * frequently, while still allowing the app to update normally.
+ * That means calling redraw_window() and all the set_*() functions
+ * normally, but only calling acquire_all_info() every so often.
+ * As it stands, we only call acquire_all_info() once every three
+ * seconds (once every thirty updates) . . . I'm not entirely sure
+ * /how/ this could cause interactivity problems, but hey . . .
+ *
+ * So, given the base rate of once every three seconds, we want to
+ * change this test to . . . */
+ if (update++ == (3000/samplerate)) {
acquire_all_info();
update = 0;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmacpi.git
More information about the Pkg-wmaker-commits
mailing list