diff -rauN wmload-0.9.2_orig/mask2.xbm wmload-0.9.2/mask2.xbm --- wmload-0.9.2_orig/mask2.xbm 1997-07-17 12:14:18.000000000 +0200 +++ wmload-0.9.2/mask2.xbm 2006-02-04 14:50:55.000000000 +0100 @@ -1,5 +1,5 @@ -#define mask2_width 54 -#define mask2_height 54 +#define mask2_width 56 +#define mask2_height 56 static unsigned char mask2_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -32,4 +32,5 @@ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; diff -rauN wmload-0.9.2_orig/mask.xpm wmload-0.9.2/mask.xpm --- wmload-0.9.2_orig/mask.xpm 1997-07-17 12:14:17.000000000 +0200 +++ wmload-0.9.2/mask.xpm 2006-02-04 14:50:30.000000000 +0100 @@ -1,67 +1,69 @@ /* XPM */ static char *mask_xpm[] = { /* width height num_colors chars_per_pixel */ -" 54 54 6 1", +" 56 56 6 1", /* colors */ -". c #000000", -"# c #282828", -"a c #ffffff", -"b c #5a5a5a", -"c c #979797", -"d c #e6e6e6", +". c #4c5481", +"# c #2e334e", +"a c #525b8c", +"b c #5e6881", +"c c #8492b5", +"d c #b8ccfd", /* pixels */ -".....................................................#", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -".bcd#################################################a", -"#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +".......................................................#", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +".bcd###################################################a", +"#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; diff -rauN wmload-0.9.2_orig/wmload.c wmload-0.9.2/wmload.c --- wmload-0.9.2_orig/wmload.c 1997-07-17 12:51:06.000000000 +0200 +++ wmload-0.9.2/wmload.c 2006-02-04 14:49:00.000000000 +0100 @@ -22,15 +22,15 @@ /* Global Data storage/structures ********************************************/ static long cp_time[NCPUSTATES]; static long last[NCPUSTATES]; -int ONLYSHAPE=0; /* default value is noshape */ -int updatespeed = 4; +int ONLYSHAPE=1; /* default value is shape */ +int updatespeed = 200; static char *help_message[] = { "where options include:", -" -u updatespeed", +" -u updatespeed in microseconds", " -exe program to start on click", " -led color of the led", " -position [+|-]x[+|-]y position of wmload", -" -shape without groundplate", +" -shape with groundplate", " -iconic start up as icon", " -withdrawn start up withdrawn", " -ver output version", @@ -50,7 +50,7 @@ Window iconwin, win; /* My home is my window */ char *ProgName; char *Geometry; -char *LedColor = "LightSeaGreen"; +char *LedColor = "#b8ccfd"; char Execute[] = "echo no program has been specified >/dev/console"; char *ERR_colorcells = "not enough free color cells\n"; char *ampers = " &"; @@ -64,8 +64,12 @@ XpmIcon wmload; XpmIcon visible; -time_t actualtime; +//time_t actualtime; +int actualtime = 0; +int curtime; +int lasttime = 0; long actualmin; +struct timeval tv; /* Function definitions ******************************************************/ void GetXPM(void); @@ -122,7 +126,7 @@ strcat(&Execute[0], " &"); continue; case 's': - ONLYSHAPE=1; + ONLYSHAPE=0; continue; case 'p': if(++i >=argc) usage(); @@ -234,7 +238,7 @@ RedrawWindow(&visible); while(1) { - if (actualtime != time(0)) +/* if (actualtime != time(0)) { actualtime = time(0); @@ -243,6 +247,25 @@ RedrawWindow(&visible); } +*/ + gettimeofday(&tv, NULL); + curtime = (int) tv.tv_usec; + if (lasttime > curtime) + lasttime = (-1) * (1000000 - lasttime); + actualtime += abs(curtime - lasttime); +// printf("abs(%i-%i)=%i += %i >= %i\n", curtime, lasttime, abs(curtime - lasttime), actualtime, updatespeed * 1000); + lasttime = curtime; + + if ( actualtime >= updatespeed * 1000 ) { +// printf("\n"); + + actualtime = 0; + + if( abs(curtime - lasttime) % updatespeed == 0) + InsertLoad(); + + RedrawWindow(&visible); + } /* read a packet */ while (XPending(dpy))