diff -rauN asload-0.9.4_orig/asload.c asload-0.9.4/asload.c --- asload-0.9.4_orig/asload.c 2000-03-09 23:12:42.000000000 +0100 +++ asload-0.9.4/asload.c 2006-02-04 14:40:45.000000000 +0100 @@ -31,15 +31,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 asload", -" -shape without groundplate", +" -shape with groundplate", " -iconic start up as icon", " -withdrawn start up withdrawn", " -ver output version", @@ -59,7 +59,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 = " &"; @@ -73,8 +73,12 @@ XpmIcon asload; 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); @@ -188,7 +192,7 @@ strcat(&Execute[0], " &"); continue; case 's': - ONLYSHAPE=1; + ONLYSHAPE=0; continue; case 'p': if(++i >=argc) usage(); @@ -302,7 +306,7 @@ RedrawWindow(&visible); while(1) { - if (actualtime != time(0)) +/* if (actualtime != time(0)) { actualtime = time(0); @@ -311,7 +315,26 @@ 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)) { diff -rauN asload-0.9.4_orig/mask.xpm asload-0.9.4/mask.xpm --- asload-0.9.4_orig/mask.xpm 1998-09-25 10:12:10.000000000 +0200 +++ asload-0.9.4/mask.xpm 2006-02-04 14:14:42.000000000 +0100 @@ -3,12 +3,12 @@ /* width height num_colors chars_per_pixel */ " 54 54 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",