wmacpi: Bump to version 1.99r1.

Source obtained from http://sourceforge.net/projects/wmacpi/files/.
This commit is contained in:
Doug Torrance 2014-08-18 17:56:15 -05:00 committed by Carlos R. Mafra
parent 6961aed640
commit e5b50109b6
4 changed files with 22 additions and 15 deletions

View file

@ -19,7 +19,7 @@ under /proc/acpi, reads status information from them, and then
displays summaries. displays summaries.
Version 1.99 and later provides full support for multiple Version 1.99 and later provides full support for multiple
batteries. You can tell it to monitor a particular batter with the -m batteries. You can tell it to monitor a particular battery with the -m
option, which will display the percentage remaining and current status option, which will display the percentage remaining and current status
message for that battery. The time remaining and AC/battery status are message for that battery. The time remaining and AC/battery status are
global - the time remaining is calculated based on all batteries found global - the time remaining is calculated based on all batteries found

View file

@ -71,11 +71,11 @@ int main(int argc, char *argv[])
if(optarg != NULL) { if(optarg != NULL) {
samples = atoi(optarg); samples = atoi(optarg);
if(samples > 1000 || samples <= 0) { if(samples > 1000 || samples <= 0) {
printf("Please specify a reasonable number of samples\n"); fprintf(stderr, "Please specify a reasonable number of samples\n");
exit(1); exit(1);
} }
} }
printf("samples: %d\n", samples); pinfo("samples: %d\n", samples);
sleep_time = 1000000/samples; sleep_time = 1000000/samples;
break; break;
default: default:

View file

@ -96,8 +96,6 @@ typedef struct {
* It's a macro because I'm too lazy to deal with varargs. * It's a macro because I'm too lazy to deal with varargs.
*/ */
static int verbosity = 0;
#define pdebug(fmt, arg...) \ #define pdebug(fmt, arg...) \
do { \ do { \
if (verbosity > 2) \ if (verbosity > 2) \
@ -124,6 +122,8 @@ static int verbosity = 0;
battery_t batteries[MAXBATT]; battery_t batteries[MAXBATT];
int batt_count; int batt_count;
int verbosity;
/* check if apm/acpi is enabled, etc */ /* check if apm/acpi is enabled, etc */
int power_init(void); int power_init(void);
/* fill global_t with data */ /* fill global_t with data */

View file

@ -63,6 +63,7 @@ typedef struct {
Dockapp *dockapp; Dockapp *dockapp;
global_t *globals; global_t *globals;
int count = 0; /* global timer variable */ int count = 0; /* global timer variable */
/* extern int verbosity; */
/* Time for scroll updates */ /* Time for scroll updates */
#define DEFAULT_UPDATE 150 #define DEFAULT_UPDATE 150
@ -584,13 +585,19 @@ void set_batt_id_area(int bno)
void usage(char *name) void usage(char *name)
{ {
printf("%s - help\t\t[timecop@japan.co.jp]\n\n" printf("%s - help\t\t[simon@dreamcraft.com.au]\n\n"
"-d display\t\tdisplay on remote display <display>\n" "-d display\t\tdisplay on remote display <display>\n"
"-b\t\t\tmake noise when battery is critical low (beep)\n" "-b\t\t\tmake noise when battery is critical low (beep)\n"
"-c value\t\tset critical low alarm at <value> percent\n" "-c value\t\tset critical low alarm at <value> percent\n"
"\t\t\t(default: 10 percent)\n" "\t\t\t(default: 10 percent)\n"
"-m <battery number>\tbattery number to monitor\n" "-m <battery number>\tbattery number to monitor\n"
"-v\t\t\tincrease verbosity.\n" "-s <sample rate>\trate at which to sample battery status\n"
"\t\t\tdefault 100 (once every three seconds)\n"
"-n\t\t\tdo not blink\n"
"-w\t\t\trun in command line mode\n"
"-a <samples>\t\tsamples to average over (cli mode only)\n"
"-v\t\t\tincrease verbosity\n"
"\t\t\tcan be used multiple times to increase verbosity further\n"
"-h\t\t\tdisplay this help\n", "-h\t\t\tdisplay this help\n",
name); name);
} }
@ -664,11 +671,6 @@ int main(int argc, char **argv)
globals->crit_level = 10; globals->crit_level = 10;
battery_no = 1; battery_no = 1;
/* see if whatever we want to use is supported */
if (power_init())
/* power_init functions handle printing error messages */
exit(1);
/* parse command-line options */ /* parse command-line options */
while ((ch = getopt(argc, argv, "d:c:m:s:a:hnwvV")) != EOF) { while ((ch = getopt(argc, argv, "d:c:m:s:a:hnwvV")) != EOF) {
switch (ch) { switch (ch) {
@ -731,7 +733,7 @@ int main(int argc, char **argv)
if(optarg != NULL) { if(optarg != NULL) {
samples = atoi(optarg); samples = atoi(optarg);
if(samples > 1000 || samples <= 0) { if(samples > 1000 || samples <= 0) {
printf("Please specify a reasonable number of samples\n"); fprintf(stderr, "Please specify a reasonable number of samples\n");
exit(1); exit(1);
} }
} }
@ -743,6 +745,11 @@ int main(int argc, char **argv)
} }
/* see if whatever we want to use is supported */
if (power_init())
/* power_init functions handle printing error messages */
exit(1);
/* check for cli mode */ /* check for cli mode */
if (cli) { if (cli) {
cli_wmacpi(samples); cli_wmacpi(samples);