Hello, Here is a patch to restore the --dontblink option in wmlaptop2.
Nicolas
From 571f655a7a72b1091cb0463658de6d776bc5b45f Mon Sep 17 00:00:00 2001
From: Nicolas Bonifas <[email protected]> Date: Sun, 11 Oct 2009 16:12:28 +0200 Subject: [PATCH] Restore --dontblink option. --- src/draw.c | 3 ++- src/main.c | 6 ++++++ src/main.h | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletions(-) diff --git a/src/draw.c b/src/draw.c index 42684a7..7f45904 100644 --- a/src/draw.c +++ b/src/draw.c @@ -185,7 +185,8 @@ void draw_cpuload() /* blinking CPULOAD */ draw_area(0, 117 + (lastCpuLoad == 100 ? 7 : 0), 37, 7, 4, 27); - lastCpuLoad = (lastCpuLoad == 100 ? 101 : 100); + if (!args_dontBlink100) + lastCpuLoad = (lastCpuLoad == 100 ? 101 : 100); /* drawing number <1> */ draw_area(4, 71, 4, 7, 44, 27); diff --git a/src/main.c b/src/main.c index 3fd524a..bd769e4 100644 --- a/src/main.c +++ b/src/main.c @@ -36,6 +36,7 @@ struct power_str powerState; short args_shutdownDelay = AUTOSHUTDOWN_LEAVE; char args_autoAlarm = AUTOALARM_LEAVE; bool args_beQuiet = ARGSDEF_LEAVE; + bool args_dontBlink100 = ARGSDEF_DONTBLINK100; double powerrate = 1; double cap_total = 0; @@ -113,6 +114,7 @@ void usage(char *prog, char *unknowOpt) fprintf(stderr, "\n"); fprintf(stderr, "[X-options]:\n"); fprintf(stderr, " --display=NAME set the display to open\n"); + fprintf( stderr, " --dontblink if you dont want to see \"CPULOAD\" blinking at 100%%\n"); fprintf(stderr, "[AUTOSCRIPT-options]:\n"); fprintf(stderr, " --auto-shutdown=off|N enable autoshutdown when battery percentage is at\n"); fprintf(stderr, " N%% (and AC adapter is not plugged in), or disable\n"); @@ -162,6 +164,10 @@ void setArgs(int argc, char **argv) args_XDisplayName++; continue; } + if(!strcmp(argv[i], "--dontblink")){ + args_dontBlink100 = true; + continue; + } if(!strncmp(argv[i], "--auto-shutdown=", 16)) { EXIT_IF_ALREADY_SET( args_autoShutdown, AUTOSHUTDOWN_LEAVE, "autoShutDown" ); if(!strcmp( &argv[i][16], "off")) diff --git a/src/main.h b/src/main.h index 35d60bc..a8ac716 100644 --- a/src/main.h +++ b/src/main.h @@ -325,6 +325,12 @@ extern short args_shutdownDelay; extern char args_autoAlarm; +/* don't blink when we are at 100 cpuload (by Daniel Winkler) */ +#ifndef ARGSDEF_DONTBLINK100 +#define ARGSDEF_DONTBLINK100 false +#endif +extern bool args_dontBlink100; + /* don't print messages and warnings */ #ifndef ARGSDEF_BEQUIET #define ARGSDEF_BEQUIET false -- 1.6.3.3 -- To unsubscribe, send mail to [email protected].
