summaryrefslogtreecommitdiff
path: root/wmlaptop/wmlaptop-ondemand.diff
blob: a9758170105f257fe905f17179621e540f5a34ad (plain)
    1 diff -Nru wmlaptop-1.4-orig/src/battery.c wmlaptop-1.4/src/battery.c
    2 --- wmlaptop-1.4-orig/src/battery.c	2008-04-18 21:55:54.497550614 +0300
    3 +++ wmlaptop-1.4/src/battery.c	2008-04-18 21:56:45.002550126 +0300
    4 @@ -15,6 +15,8 @@
    5   */
    6  
    7  #include "battery.h"
    8 +#include <dirent.h>
    9 +
   10  
   11  bool mallocBatteryVector( )
   12  {
   13 @@ -96,9 +98,10 @@
   14  	}
   15  	
   16  	powerState.type = SUPPORT_ACPI;
   17 -	powerState.updater = ACPI_Update; 
   18 +	powerState.updater = print_battery;
   19 +
   20 +	
   21  	
   22 -	/* counting number of batteries */
   23  	powerState.nBatt = 0;
   24  	powerState.batteryVector = NULL;
   25  	
   26 @@ -108,26 +111,23 @@
   27  		return ERROR;
   28  	}
   29  	
   30 -	/* a cicle for creating as many battery_str structures 
   31 -	 * as are the batteries on the laptop; everyone will be
   32 -	 * filled with static informations */
   33 +
   34  	while ((batt = readdir (battdir)))
   35  	{
   36  		
   37  		name = batt->d_name;
   38 -		/* jump . and .. */
   39 +
   40  		if (!strncmp (".", name, 1) || !strncmp ("..", name, 2))
   41  			continue;
   42  		
   43  		countBattery++;
   44  		
   45 -		/* adding a battery to powerState vector */
   46 +
   47  		if( mallocBatteryVector( ) == ERROR )
   48  			return ERROR;
   49  		
   50  		batPtr = powerState.batteryVector[ powerState.nBatt - 1 ];
   51  		
   52 -		/* we can find 'status' or even 'state' */
   53  		snprintf( path, 52, "%s/%s/status", ACPI_BATTERY_DIR, name );
   54  		if (access(path, R_OK) == SUCCESS )
   55  			snprintf( batPtr -> stateFile, 52, "%s/%s/status",ACPI_BATTERY_DIR, name );
   56 @@ -135,20 +135,17 @@
   57  			snprintf( batPtr -> stateFile, 52, "%s/%s/state", ACPI_BATTERY_DIR, name );
   58  		
   59  		
   60 -		/* calculating maximum capacity of this battery
   61 -		 * reading file infos */
   62 +
   63  		batPtr -> useLFC = ACPI_lfcArgs_get( countBattery );
   64  		batPtr -> counter = countBattery;
   65  		snprintf( batPtr -> infoFile, 52, "%s/%s/info", ACPI_BATTERY_DIR, name );
   66  		batPtr -> present = ACPI_maxCapacity ( batPtr );
   67  		
   68 -		/* THIS IS NOT A BATTERY ! set error field to true: don't use it */
   69  		if( batPtr -> capacity == ~0x00 && batPtr -> present == true )
   70  		{
   71  			batPtr -> error = true;
   72  		}
   73  		
   74 -		/* filler selection :P */
   75  		batPtr -> filler = ACPI_Filler;
   76  	}
   77  	
   78 @@ -166,8 +163,6 @@
   79  	u_int16 saltCounter = 0;
   80  	char *  errorMessage = "wmlaptop will ignore this battery. If you don't want to see\nthis message, use '-q' option as argument.\n";
   81  	
   82 -	/* we control 'last full capacity' tag before, if this 
   83 -	 * don't exists or it's value is 0, then we use 'design capacity' */
   84  	char *  lfcTagPointer = NULL;
   85  	char *  dcTagPointer  = NULL;
   86  	u_int32 lastFullCapacity = 0;
   87 @@ -189,7 +184,7 @@
   88  	
   89  	if( !strcmp( presentString, "present:" ) && !strcmp( yesNoString, "no" ) )
   90  	{
   91 -		/* to avoid division by 0 ? */
   92 +
   93  		p -> capacity = 1;
   94  		return false;
   95  	}
   96 @@ -207,11 +202,11 @@
   97  	}
   98  	
   99  	
  100 -	/* naah.. */
  101 +
  102  	if( saltCounter >= 492 && !dcTagPointer && !lfcTagPointer )
  103  	{
  104  		PRINTQ( stderr, "The info file (%s) has not \n'design capacity' and not event 'last full capacity' tag\n%s\n", p -> infoFile, errorMessage );
  105 -		/* we treat 1111.1111.1111.1111 as error here */
  106 +
  107  		p -> capacity =  ~0x00;
  108  	}
  109  	
  110 @@ -340,66 +335,6 @@
  111  }
  112  
  113  
  114 -void ACPI_Update ( )
  115 -{
  116 -	FILE * fp;
  117 -	char *where = NULL;
  118 -	char  buf[512];
  119 -	
  120 -	register int i;
  121 -	register u_int32 capacitySum = 0;
  122 -	register u_int32 actualStateSum = 0;
  123 -	
  124 -	for( i = 0; i < powerState.nBatt; i++ )
  125 -	{
  126 -		powerState.batteryVector[i] -> filler( powerState.batteryVector[i] );
  127 -		if (powerState.batteryVector[i] -> present) {
  128 -			capacitySum += powerState.batteryVector[i] -> capacity;
  129 -			actualStateSum += powerState.batteryVector[i] -> actualState;
  130 -		}
  131 -	}
  132 -
  133 -	if (capacitySum > 0)
  134 -		powerState.percentage = (actualStateSum * 100) / capacitySum;
  135 -	else
  136 -		powerState.percentage = 0;
  137 -	
  138 -	/* battery charger information reading
  139 -	 * thanks to wmpower */
  140 -	
  141 -	if (!(fp = fopen ("/proc/acpi/ac_adapter/0/status", "r")))
  142 -		if (!(fp = fopen ("/proc/acpi/ac_adapter/ACAD/state", "r")))
  143 -			if (!(fp = fopen ("/proc/acpi/ac_adapter/AC/state", "r")))
  144 -				if (!(fp = fopen ("/proc/acpi/ac_adapter/ADP1/state", "r")))
  145 -					return;
  146 -	
  147 -	fread_unlocked (buf, 512, 1, fp);
  148 -	fclose(fp);
  149 -	
  150 -	if (strncmp(buf, "state:",  6) == 0)
  151 -		where = buf + 26;
  152 -	if (strncmp(buf, "Status:", 7) == 0)
  153 -		where = buf + 26;
  154 -	
  155 -	if (where)
  156 -	{
  157 -		if (where[0] == 'n')
  158 -			powerState.isCharging = true;
  159 -		if (where[0] == 'f')
  160 -			powerState.isCharging = false;
  161 -	}
  162 -	
  163 -    if( args_ttyMode )
  164 -        return;
  165 -
  166 -
  167 -	setNewBatteryState();
  168 -	
  169 -	
  170 -	return;
  171 -}
  172 -
  173 -
  174  /* this vector will contain in each position the number of the
  175   * battery the user wants to be used with 'last full capacity' */
  176  static u_int8 * lfcArgsVector = NULL;
  177 @@ -571,7 +506,7 @@
  178  		}
  179  		else
  180  		{
  181 -			estimatedTimeClock( );
  182 +			print_battery( );
  183  		}	
  184  		draw_all();
  185  		lastChargingState = powerState.isCharging;
  186 @@ -580,101 +515,177 @@
  187  	}
  188  }
  189  
  190 +void read_power()
  191 +{
  192 +	DIR *dir;
  193 +	struct dirent *dirent;
  194 +	FILE *file;
  195 +	extern double powerrate;
  196 +	char filename[256];
  197  
  198  
  199 -void estimatedTimeClock ( )
  200 -{
  201 -	/* we remember last 5 percent values changes.
  202 -	 * for every value we record even the exact moment when this
  203 -	 * value was recorded (reading global variable secondsCounter) */
  204 -	static u_int32 values[5][2];
  205 -	static u_int8  valueIndex = ~0;
  206 +	dir = opendir("/proc/acpi/battery");
  207 +	if (!dir)
  208 +		return;
  209  	
  210 -	static bool lastIsCharging = false;
  211 +	while ((dirent = readdir(dir))) {
  212  	
  213 -	register u_int8  diffPercentage = 0;
  214 -	register u_int32 diffTime       = 0;
  215 -	register int i;
  216 +		char line[1024];
  217 +				
  218 +		sprintf(filename, "/proc/acpi/battery/%s/state", dirent->d_name);
  219 +		file = fopen(filename, "r");
  220 +		if (!file)
  221 +			continue;
  222 +		memset(line, 0, 1024);
  223 +		while (fgets(line, 1024, file) != NULL) {
  224 +			char *c;
  225 +			if (strstr(line, "present:") && strstr(line, "no"))
  226 +				break;
  227  	
  228 +			c = strchr(line, ':');
  229 +			if (!c)
  230 +				continue;
  231 +			c++;
  232  	
  233 -	/* if battery charge is plugged in, values fetched before are
  234 -	 * reset to zero and return (draw_all() function already called
  235 -	 * by updater will draw TIME unlit, to indicate that we haven't
  236 -	 * a time estimation */
  237 -	if( lastIsCharging != powerState.isCharging )
  238 -	{
  239 -		lastIsCharging = powerState.isCharging;
  240 -		valueIndex = ~0;
  241 -		powerState.remainingTime = 0;
  242 -		return;
  243 +			if (strstr(line, "present rate") && strstr(c, "mW"))
  244 +				powerrate = strtoull(c, NULL, 10) / 1000.0;
  245  	}
  246 +		fclose(file);
  247  	
  248 +	}
  249 +	closedir(dir);
  250 +//	fprintf(stdout,"powerrate = %3.1f\n", powerrate);
  251  	
  252 -	for( i = 4; i > 0; i-- )
  253 -	{
  254 -		values[i][1] = values[i-1][1];
  255 -		values[i][0] = values[i-1][0];
  256 +}
  257 +
  258 +
  259 +void battery_capacity()
  260 +{
  261 +	DIR *dir;
  262 +	struct dirent *dirent;
  263 +	FILE *file;
  264 +	extern double capacity;
  265 +	char filename[256];
  266 +	
  267 +	
  268 +	dir = opendir("/proc/acpi/battery");
  269 +	if (!dir)
  270 +		return;
  271 +	
  272 +	while ((dirent = readdir(dir))) {
  273 +		
  274 +		char line[1024];
  275 +				
  276 +		sprintf(filename, "/proc/acpi/battery/%s/info", dirent->d_name);
  277 +		file = fopen(filename, "r");
  278 +		if (!file)
  279 +			continue;
  280 +		memset(line, 0, 1024);
  281 +		while (fgets(line, 1024, file) != NULL) {
  282 +			char *c;
  283 +			if (strstr(line, "present:") && strstr(line, "no"))
  284 +				break;
  285 +
  286 +			c = strchr(line, ':');
  287 +			if (!c)
  288 +				continue;
  289 +			c++;
  290 +			
  291 +			if (strstr(line, "last full capacity") && strstr(c, "mWh"))
  292 +				capacity = strtoull(c, NULL, 10) / 1000.0;
  293 +		}
  294 +		fclose(file);		
  295  	}
  296 -	values[i][0] = powerState.percentage;
  297 -	values[i][1] = secondsCounter;
  298 +	closedir(dir);
  299 +//	fprintf(stdout,"capacity = %3.1f\n", capacity);
  300  	
  301 +}
  302  	
  303 -	valueIndex += 1;
  304 -	if( valueIndex > 4 )
  305 -		valueIndex = 4;
  306 +void print_battery(void)
  307 +{
  308 +	DIR *dir;
  309 +	struct dirent *dirent;
  310 +	FILE *file;
  311 +	double rate = 0;
  312 +	double cap = 0;
  313  	
  314 -	/* if it's the first measure, jump the comparation */
  315 -	if( valueIndex > 0 )
  316 -	{
  317 -		u_int32 remainingSeconds;
  318 -		/* we have into values[0] the most recent value,
  319 -		 * and in values[ valueIndex ] the less one  */
  320 +	char filename[256];
  321  		
  322 -		if( powerState.isCharging )
  323 -			diffPercentage = values[0][0] - values[ valueIndex ][0];
  324 -		else
  325 -			diffPercentage = values[ valueIndex ][0] - values[0][0];
  326  		
  327 -		diffTime       = values[0][1] - values[ valueIndex ][1];
  328 +	dir = opendir("/proc/acpi/battery");
  329 +	if (!dir)
  330 +		return;
  331 +
  332 +	while ((dirent = readdir(dir))) {
  333 +		double voltage = 0.0;
  334 +		double amperes_drawn = 0.0;
  335 +		double watts_drawn = 0.0;
  336 +		double amperes_left = 0.0;
  337 +		double watts_left = 0.0;		
  338 +		char line[1024];
  339 +		powerState.isCharging = false;
  340 +
  341 +		if (strlen(dirent->d_name) < 3)
  342 +			continue;
  343 +
  344 +		sprintf(filename, "/proc/acpi/battery/%s/state", dirent->d_name);
  345 +		file = fopen(filename, "r");
  346 +		if (!file)
  347 +			continue;
  348 +		memset(line, 0, 1024);
  349 +		while (fgets(line, 1024, file) != NULL) {
  350 +			char *c;
  351 +			if (strstr(line, "present:") && strstr(line, "no"))
  352 +				break;
  353  		
  354 -		/* this is the logic way: if diffTime is the number of seconds for
  355 -		 * losing(gaining) diffPercentage percent battery charge, how many
  356 -		 * seconds will it takes to lose(gain) remaining points ? in other words:
  357 -		 * diffTime : diffPercentage = remainingSeconds : powerState.percentage
  358 -		 * (or if we are charging    = remainingSeconds : (100-powerState.percentage))
  359 -		 * it shouldn't be possible to have diffPercentage = 0
  360 -		 * because this function is called everytime that percent changes */
  361 -		if( diffPercentage == 0 )
  362 -		{
  363 -			/* sometime it happends that 'diffPercentage == 0': i recieved some bug
  364 -			 * report about this. I don't know why this happends, and i didn't find
  365 -			 * any way to correct this conceptually, so i have to put this condition
  366 -			 * here and turn off the estimated remaining time */
  367 -			PRINTQ( stderr, "There is no difference of percentage between the first\n");
  368 -			PRINTQ( stderr, "relevation and the last one: i have to put remainingTime to 0\n");
  369 -			remainingSeconds = 0;
  370 +			if (strstr(line, "charging state:")
  371 +			    && !strstr(line, "discharging")){
  372 +				powerState.isCharging = true;
  373  		}
  374 -		else
  375 -		{
  376 -			if( powerState.isCharging )
  377 -				remainingSeconds = ( diffTime * (100-powerState.percentage) ) / diffPercentage;
  378 -			else
  379 -				remainingSeconds = ( diffTime * powerState.percentage ) / diffPercentage;
  380 +			c = strchr(line, ':');
  381 +			if (!c)
  382 +				continue;
  383 +			c++;
  384 +
  385 +			if (strstr(line, "present voltage")) 
  386 +				voltage = strtoull(c, NULL, 10) / 1000.0;
  387 +		
  388 +			if (strstr(line, "remaining capacity") && strstr(c, "mW"))
  389 +				watts_left = strtoull(c, NULL, 10) / 1000.0;
  390 +
  391 +			if (strstr(line, "remaining capacity") && strstr(c, "mAh"))
  392 +				amperes_left = strtoull(c, NULL, 10) / 1000.0; 
  393 +
  394 +			if (strstr(line, "present rate") && strstr(c, "mW"))
  395 +				watts_drawn = strtoull(c, NULL, 10) / 1000.0 ;
  396 +
  397 +			if (strstr(line, "present rate") && strstr(c, "mA"))
  398 +				amperes_drawn = strtoull(c, NULL, 10) / 1000.0;
  399 +
  400  		}
  401 +		fclose(file);
  402 +			
  403  		
  404 -		/* value in minutes */
  405 -		powerState.remainingTime = remainingSeconds / 60;
  406 -	}
  407 -	else
  408 -		powerState.remainingTime = 0;
  409 -	
  410 +		if (!powerState.isCharging) {
  411 +			rate += watts_drawn + voltage * amperes_drawn;
  412 +			cap += watts_left + voltage * amperes_left;
  413 +			powerState.remainingTime =  60*cap/rate;
  414 +			powerrate = rate;
  415 +//			fprintf(stdout,"taxa = %3.1fW horas=%3.1f \n", rate, cap/rate);
  416 +		} 
  417 +		if (powerState.isCharging){
  418 +			rate += watts_drawn + voltage * amperes_drawn;
  419 +//			fprintf(stdout,"watts left = %3.1f, watts drawn=%3.1f \n", watts_left, watts_drawn);
  420 +			/* time to charge battery at 100% */ 
  421 +			powerState.remainingTime = 60*(capacity - watts_left)/watts_drawn;
  422 +	}
  423 +	
  424 +		powerrate = rate;
  425 +		powerState.percentage = 100*(watts_left/capacity);
  426 +//		fprintf(stdout, "capacidade = %3.1f \n", capacity);
  427 +//		fprintf(stdout,"porcentagem = %d \n", powerState.percentage);
  428  	
  429 -#ifdef DEBUG
  430 -	printf("TEMPO TRASCORSO: %u:%02u   (%u secondi)\n",diffTime/60,diffTime%60,diffTime);
  431 -	printf("PERCENTUALI: values[0] = %u,  values[%d] = %u\n", values[0][0], valueIndex, values[valueIndex][0] );
  432 -	printf("TEMPIVALORI: values[0] = %u,  values[%d] = %u\n", values[0][1], valueIndex, values[valueIndex][1] );
  433 -	printf("DIFFENREZA: %d\n", diffPercentage );
  434 -	printf("TEMPOSTIMATO: %d\n\n\n", powerState.remainingTime );
  435 -#endif
  436 +	}
  437 +	closedir(dir);
  438  }
  439  
  440 diff -Nru wmlaptop-1.4-orig/src/battery.h wmlaptop-1.4/src/battery.h
  441 --- wmlaptop-1.4-orig/src/battery.h	2008-04-18 21:55:54.497550614 +0300
  442 +++ wmlaptop-1.4/src/battery.h	2008-04-18 21:56:45.002550126 +0300
  443 @@ -109,11 +109,10 @@
  444   * state is changed. */
  445  void setNewBatteryState( );
  446  
  447 +void read_power();
  448  
  449 -/* function invoked every time that remaining battery percentage changes
  450 - * and calculates estimated remaining time.
  451 - * (if changed from previous updates the dockapp */
  452 -void estimatedTimeClock ( );
  453 +void battery_capacity();
  454  
  455 +void print_battery();
  456  
  457  #endif
  458 diff -Nru wmlaptop-1.4-orig/src/cpu.c wmlaptop-1.4/src/cpu.c
  459 --- wmlaptop-1.4-orig/src/cpu.c	2008-04-18 21:55:54.497550614 +0300
  460 +++ wmlaptop-1.4/src/cpu.c	2008-04-18 21:56:45.002550126 +0300
  461 @@ -65,10 +65,9 @@
  462  	return loadline;
  463  }
  464  
  465 -
  466  void manageCpuLoad( )
  467  {
  468 -	static u_int8 lastCpuLoad = 100;
  469 +//	static u_int8 lastCpuLoad = 100;
  470  #ifndef LONGRUN
  471  	static u_int32 lastFreqChange = 0;
  472  #endif
  473 @@ -76,10 +75,10 @@
  474  	cpuLoad = getCpuLoad();
  475  
  476  	
  477 -	if( cpuLoad != lastCpuLoad || cpuLoad == 100 )
  478 -		draw_all();
  479 +//	if( cpuLoad != lastCpuLoad || cpuLoad == 100 )
  480 +//		draw_all();
  481  	
  482 -	lastCpuLoad = cpuLoad;
  483 +//	lastCpuLoad = cpuLoad;
  484  	
  485  	
  486          /* Longrun manages frequency automatically, so skip all this */
  487 @@ -120,7 +119,7 @@
  488  	
  489  	/* let's read actual frequency to avoid a two seconds wait
  490  	 * dto now it */
  491 -	cpuReadFreq();
  492 +//	cpuReadFreq();
  493  #endif
  494  	
  495  	return;
  496 @@ -130,10 +129,14 @@
  497  
  498  void cpuReadFreq( )
  499  {
  500 +	
  501  #ifndef LONGRUN
  502  	FILE * fp;
  503  	char red[10];
  504  	
  505 +	if (governor != 1)
  506 +		cpuState.setFreqFile = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq";
  507 +	
  508  	if( (fp = fopen( cpuState.setFreqFile, "r" )) == NULL )
  509  	{
  510  		fprintf(stderr, "Error reading the info file (%s):\n%s\n", cpuState.setFreqFile, strerror(errno) );
  511 @@ -170,19 +173,50 @@
  512  }
  513  
  514  
  515 +void cpuReadTemp( ){
  516 +	DIR *dir;
  517 +	struct dirent *dirent;
  518 +	FILE *file;
  519 +	int cpuTemp = 0;
  520 +	char filename[256];
  521  
  522 -void cpuCheckFreq()
  523 -{
  524 -	static u_int32 lastCpuFreq = 0;
  525 +        dir = opendir("/proc/acpi/thermal_zone");
  526 +	if (!dir){
  527 +		return;
  528 +	}
  529 +	while ((dirent = readdir(dir))) {
  530 +		char line[1024];
  531  	
  532 -	cpuReadFreq();
  533 +		if (strlen(dirent->d_name) < 3)
  534 +			continue;
  535  	
  536 -	if( lastCpuFreq != cpuState.actualFreq )
  537 -		draw_all();
  538  	
  539 -	lastCpuFreq = cpuState.actualFreq;
  540 -}
  541 +	sprintf(filename, "/proc/acpi/thermal_zone/%s/temperature", dirent->d_name);
  542 +	file = fopen(filename, "r");
  543 +	if (!file)
  544 +		continue;
  545 +	memset(line, 0, 1024);
  546 +	while (fgets(line, 1024, file) != NULL) {
  547 +		char *c;
  548 +	//	if (strstr(line, "present:") && strstr(line, "no"))
  549 +	//		break;
  550 +
  551 +		c = strchr(line, ':');
  552 +		if (!c)
  553 +			continue;
  554 +		c++;
  555 +		
  556 +		if (strstr(line, "temperature") && strstr(c, "C"))
  557 +			cpuTemp = strtoull(c, NULL, 10);
  558  
  559 +	}
  560 +		fclose(file);
  561 +		
  562 +		cpuState.Temp = cpuTemp;
  563 +//		fprintf(stdout,"temperatura = %d\n", cpuState.Temp);
  564 +	}
  565 +	closedir(dir);
  566 +}
  567  
  568  void cpuSetFreq( bool direction, bool speed )
  569  {
  570 diff -Nru wmlaptop-1.4-orig/src/cpu.h wmlaptop-1.4/src/cpu.h
  571 --- wmlaptop-1.4-orig/src/cpu.h	2008-04-18 21:55:54.497550614 +0300
  572 +++ wmlaptop-1.4/src/cpu.h	2008-04-18 21:56:45.003550530 +0300
  573 @@ -37,6 +37,8 @@
  574   * global variable cpuState */
  575  void cpuReadFreq( );
  576  
  577 +/* read cpu temperature and puts into cpuState.Temp */
  578 +void cpuReadTemp();
  579  
  580  /* invoked by events cycle  e time every 2 seconds, it reads actual
  581   * frequency (calling readCpuFreq) and it redraws the dockapp if it's
  582 diff -Nru wmlaptop-1.4-orig/src/draw.c wmlaptop-1.4/src/draw.c
  583 --- wmlaptop-1.4-orig/src/draw.c	2008-04-18 21:55:54.497550614 +0300
  584 +++ wmlaptop-1.4/src/draw.c	2008-04-18 21:56:45.003550530 +0300
  585 @@ -16,6 +16,7 @@
  586  
  587  #include "draw.h"
  588  
  589 +extern double powerrate;
  590  
  591  void draw_area(int sx, int sy, int w, int h, int dx, int dy)
  592  {
  593 @@ -37,9 +38,13 @@
  594  	
  595  	draw_cpuload ( );
  596  	
  597 +	if (governor == 1){ // 1 means userspace
  598  	draw_auto_freq ( );
  599 -	
  600  	draw_freq_arrows ( );
  601 +	} else {
  602 +		draw_cputemp();
  603 +		draw_powerrate();
  604 +	}
  605  	
  606  	draw_actual_freq ( );
  607  	
  608 @@ -59,6 +64,18 @@
  609  	/* Mhz */
  610  	draw_area( 46, 119, 15, 9, 38, 51 );
  611  	
  612 +	// colocar graus C e Watts se ondemand
  613 +	/* C */
  614 +	if (governor == 2){
  615 +		/* draw C (Celsius) */
  616 +		draw_area( 0, 117, 4, 7, 52, 36 );
  617 +		/* draw W (Watts) */
  618 +		if (powerState.isCharging)
  619 +			draw_area( 70, 130, 9, 7, 25, 37 );
  620 +		else
  621 +			draw_area( 81, 130, 9, 7, 25, 37 );
  622 +	}
  623 +	
  624  	/* two gray lines */
  625  	draw_area( 66, 118, 55, 1, 4, 24 );
  626  	draw_area( 66, 118, 55, 1, 4, 48 );
  627 @@ -87,10 +104,6 @@
  628  	
  629  	u_int8 numBars;
  630  	int i;
  631 -	int j;
  632 -	int battery = 0;
  633 -	int batterySlot;
  634 -	int presentBatteries = 0;
  635  	
  636  	if( powerState.percentage == 100 )
  637  		/* drawing the green <1> at first position*/
  638 @@ -118,30 +131,15 @@
  639  	/* drawing <%> symbol of the right color */
  640  	draw_area( 40, baseY, 7, 7, 20, 5 );
  641  
  642 -	
  643 -	/* let's see, how many batteries are present */
  644 -	for ( batterySlot = 0; batterySlot < powerState.nBatt; batterySlot ++ )
  645 -		if (powerState.batteryVector[batterySlot] -> present)
  646 -			presentBatteries ++;
  647 -
  648 -
  649 -	for( batterySlot = 0; batterySlot < powerState.nBatt; batterySlot ++ ) {
  650 -
  651 -		if (powerState.batteryVector[batterySlot] -> present) {
  652 -			battery ++;
  653 -
  654  			/* battery drawing */
  655 -			numBars = (22 * powerState.batteryVector[batterySlot] -> percentage) / 100;
  656 +	numBars = (22 * powerState.percentage) / 100;
  657  
  658  			for( i = 0; i < numBars; i++ )
  659 -				draw_area( 49 + ( i > 10 ? i - 11 : i ), 95 + ( i > 10 ? 7 : 0), 1, (7 / presentBatteries), 15+(i*2), 15 + (battery - 1) * (7 / presentBatteries + 1 ) );
  660 +	draw_area( 49 + ( i > 10 ? i - 11 : i ), 95 + ( i > 10 ? 7 : 0), 1, (7 / 1), 15+(i*2), 15  );
  661  
  662  			/* unlit remaining battery */
  663 -			for( j = i; j < 22; j++ )
  664 -				draw_area( 60, 95, 1, (7 / presentBatteries), 15 + (j*2), 15 + (battery - 1) * (7 / presentBatteries + 1 ) );
  665 -
  666 -		}
  667 -	}
  668 +//	for( j = i; j < 22; j++ )
  669 +//		draw_area( 60, 95, 1, (7 / 1), 15 + (j*2), 15 + (battery - 1) * (7 / 2 ) );
  670  
  671  	return;
  672  }
  673 @@ -232,6 +230,60 @@
  674  	
  675  }
  676  
  677 +void draw_cputemp ( )
  678 +{
  679 +	
  680 +	u_int8 decine = cpuState.Temp == 100 ? 0 : (cpuState.Temp / 10);
  681 +	u_int8 unita = cpuState.Temp % 10;
  682 +
  683 +	
  684 +	/* tens drawing */
  685 +	if( decine == 0 && cpuState.Temp != 100 )
  686 +		draw_area( 57, 75, 4, 7, 49, 27 );
  687 +	else
  688 +		draw_area( decine*4, 71, 4, 7, 40, 36 );
  689 +	
  690 +	/* units drawing  */
  691 +	draw_area( unita*4, 71, 4, 7, 45, 36 );		       	
  692 +	
  693 +	
  694 +}
  695 +
  696 +void draw_powerrate ( )
  697 +{
  698 +	
  699 +	u_int8 decine = 0;
  700 +	u_int8 unita = 0;
  701 +	u_int8 decimal = 0;
  702 +	
  703 +	if (powerrate > 10){		
  704 +		decine = (powerrate / 10);		
  705 +		unita = powerrate - decine*10;
  706 +		decimal = powerrate*10 - decine*100 - unita*10;			
  707 +	}
  708 +	else { 
  709 +		decine = 0;
  710 +		unita = powerrate;
  711 +		decimal = powerrate*10 - unita*10;
  712 +	}
  713 +	 
  714 +	/* tens drawing */
  715 +	if( decine == 0 )
  716 +		draw_area( 57, 75, 4, 7, 5, 37 );
  717 +	else
  718 +		draw_area( decine*4, 78 - powerState.isCharging*14, 4, 7, 5, 37 );
  719 +	
  720 +	/* units drawing  */
  721 +	draw_area( unita*4, 78 - powerState.isCharging*14, 4, 7, 10, 37 );
  722 +	
  723 +	/* decimal point */
  724 +	draw_area( 0, 83 - powerState.isCharging*14, 2, 1, 15, 43 );
  725 +	
  726 +	/* decimals drawing  */
  727 +	draw_area( decimal*4, 78 - powerState.isCharging*14, 4, 7, 18, 37 );
  728 +}
  729 +
  730 +
  731  void draw_auto_freq ( )
  732  {
  733  	if ( cpuState.auto_freq_state ){
  734 diff -Nru wmlaptop-1.4-orig/src/draw.h wmlaptop-1.4/src/draw.h
  735 --- wmlaptop-1.4-orig/src/draw.h	2008-04-18 21:55:54.497550614 +0300
  736 +++ wmlaptop-1.4/src/draw.h	2008-04-18 21:56:45.004550097 +0300
  737 @@ -53,10 +53,19 @@
  738  void draw_auto_freq ( );
  739  
  740  /* it draws the arrows at left and right of the cpu frequency */
  741 +
  742  void draw_freq_arrows ( );
  743  
  744 -/* it draws actua cpu frequency */
  745 +
  746 +/* it draws the actual cpu frequency */
  747  void draw_actual_freq ( );
  748  
  749 +/* it draws the cpu temperature */
  750 +void draw_cputemp();
  751 +
  752 +/* it draws the rate at which the battery is 
  753 + * discharging/charging */
  754 +void draw_powerrate();
  755 +
  756  
  757  #endif
  758 diff -Nru wmlaptop-1.4-orig/src/event.c wmlaptop-1.4/src/event.c
  759 --- wmlaptop-1.4-orig/src/event.c	2008-04-18 21:55:54.497550614 +0300
  760 +++ wmlaptop-1.4/src/event.c	2008-04-18 21:56:45.004550097 +0300
  761 @@ -16,11 +16,10 @@
  762  
  763  #include "event.h"
  764  
  765 -
  766 -
  767  void event_handler ( )
  768  {
  769 -	u_int32  update_seconds;
  770 +	u_int32  update_seconds, update_seconds2, update_seconds3;
  771 +	u_int32	 batteryUpdate, powerUpdate, tempUpdate;
  772  	u_int8   lastPercentage;
  773  	int j;
  774  
  775 @@ -31,9 +30,11 @@
  776  	secondsCounter = time(NULL);
  777  	powerState.updater();
  778  	update_seconds = time(NULL);
  779 +	update_seconds2 = update_seconds;
  780  	lastPercentage = powerState.percentage;
  781  	
  782 -	if( powerState.percentage == 100 && powerState.isCharging && args_paradisiac == PARADISIAC_ON )
  783 +
  784 +	if( powerState.percentage == 100 && powerState.isCharging && args_paradisiac == PARADISIAC_ON && governor == 1)
  785      {
  786          if( args_ttyMode && args_beQuiet == false
  787  #ifndef LONGRUN
  788 @@ -78,6 +79,7 @@
  789  				
  790  					switch ( j )
  791  					{
  792 +						if (governor == 1){
  793  						/* auto-freq */
  794  						case MREGION_AUTOFREQ:
  795  							/* toggle auto-freqency "(c)2003 LdP" scaling mode */
  796 @@ -112,7 +114,7 @@
  797  							cpuState.auto_freq_state = false;
  798  #endif
  799  							break;
  800 -							
  801 +						}
  802  					}
  803  					
  804  					/* if a cliccable region was clicked, the dockapp is redrawn */
  805 @@ -134,17 +136,32 @@
  806  		}
  807  		
  808  		
  809 -		/* update battery percentage and cpuFreq
  810 -		 * once every batteryUpdate milliseconds; check for autoscripts
  811 -		 * and cpuParadisiac too */
  812 -		if( update_seconds <= secondsCounter - (args_batteryUpdate/1000) )
  813 +		/* If cpuload is less than 90% then the system is 'idle', so we 
  814 +		 * update battery percentage, temperature and power with 
  815 +		 * defaults values (which are confortably big as to not 
  816 +		 * overuse the acpi system and generate to many wakeups (detected
  817 +		 * by Intel's powertop). 
  818 +		 * If cpuload is bigger than 90% it makes sense to check these
  819 +		 * values more often (especially the temperature), so we set
  820 +		 * the update times to default small values.
  821 +		 */
  822 +		
  823 +		if (cpuLoad < 90) {
  824 +			batteryUpdate = args_batteryUpdate;
  825 +			powerUpdate = args_powerUpdate;
  826 +			tempUpdate = args_tempUpdate;
  827 +		}
  828 +		else {
  829 +			batteryUpdate = 10;
  830 +			powerUpdate = 2;
  831 +			tempUpdate = 2;
  832 +		}
  833 +		       
  834 +		
  835 +		if( update_seconds <= secondsCounter - batteryUpdate )
  836  		{
  837  			update_seconds = secondsCounter;
  838 -                        /* longrun adjusts so quickly that if you put the check
  839 -                           after the succeeding line it consistently reads a
  840 -                           higher MHz (in ACPI) */
  841 -			cpuCheckFreq();
  842 -			powerState.updater();
  843 +			print_battery();
  844  			
  845  			if( args_autoShutdown != AUTOSHUTDOWN_OFF )
  846  				checkAutoShutdown ( );
  847 @@ -152,13 +169,31 @@
  848  			if( args_autoAlarm != AUTOALARM_OFF )
  849  				checkAutoAlarm ( );
  850  
  851 -			if( args_paradisiac == PARADISIAC_ON )
  852 -				cpuSetParadisiac ( );
  853 +//			if( args_paradisiac == PARADISIAC_ON && governor == 1)
  854 +//				cpuSetParadisiac ( );
  855 +		}
  856 +		
  857 +		if( update_seconds2 <= secondsCounter - tempUpdate ){
  858 +			update_seconds2 = secondsCounter;
  859 +			cpuReadTemp();
  860 +//			fprintf(stdout,"executei temperatura \n");
  861 +		}
  862 +		
  863 +		if( update_seconds3 <= secondsCounter - powerUpdate ){
  864 +			update_seconds3 = secondsCounter;
  865 +			read_power();
  866 +//			fprintf(stdout,"executei power \n");
  867  		}
  868  		
  869  		/* check and redraw cpu load */
  870 +		if (governor == 1)
  871  		manageCpuLoad();
  872 -		usleep( 1000*args_cpuUpdate /*150000*/ );
  873 +		if (governor == 2){
  874 +			cpuLoad = getCpuLoad();			
  875 +		}
  876 +		cpuReadFreq();		
  877 +		draw_all();
  878 +		usleep( 1000*args_cpuUpdate  );
  879  		
  880  	}
  881  }
  882 diff -Nru wmlaptop-1.4-orig/src/init.c wmlaptop-1.4/src/init.c
  883 --- wmlaptop-1.4-orig/src/init.c	2008-04-18 21:55:54.497550614 +0300
  884 +++ wmlaptop-1.4/src/init.c	2008-04-18 21:56:45.005550432 +0300
  885 @@ -189,80 +189,6 @@
  886  }
  887  
  888  
  889 -/* this chech for the string 'userspace' is in scaling_governor file under /sys/.. dir
  890 - * (only in case we are going to use SYS's way to set cpufreq). If 'userspace' is not set
  891 - * then we try to set it by ourself */
  892 -void scalingGovernorHelper( )
  893 -{
  894 -    char * scaling_governor_path = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor";
  895 -    char * scaling_governor_av_path = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors";
  896 -    char * error_msg = "Unable to read <%s>:\n%s\nwmlaptop cannot help you in cpu scaling governor\n";
  897 -    FILE * sysfp;
  898 -    FILE * sysavfp;
  899 -    char   littleBuffer[128];
  900 -    
  901 -    bool   printIt = false;
  902 -    int    i;
  903 -
  904 -    if( ( sysfp = fopen( scaling_governor_path, "r" ) ) == NULL ) {
  905 -        PRINTQ( stderr, error_msg, scaling_governor_path, strerror(errno) );
  906 -        return;
  907 -    }
  908 -
  909 -    fgets( littleBuffer, 127, sysfp );
  910 -    fclose( sysfp );
  911 -    
  912 -    if( !strcmp( littleBuffer, "userspace\n" ) )
  913 -        return;
  914 -
  915 -    if( ( sysavfp = fopen( scaling_governor_av_path, "r" ) ) == NULL ) {
  916 -        PRINTQ( stderr, error_msg, scaling_governor_av_path, strerror(errno) );
  917 -        return;
  918 -    }
  919 -    
  920 -    fgets( littleBuffer, 127, sysavfp );
  921 -    fclose( sysavfp );
  922 -    
  923 -    for( i = 0; i < strlen( littleBuffer ) - 9 ; i++ )
  924 -        if( !strncmp( littleBuffer, "userspace", 9 ) )
  925 -        {
  926 -            /* ok, module is loaded */
  927 -            printIt = true;
  928 -            break;
  929 -        }
  930 -
  931 -
  932 -    if( printIt == false ) {
  933 -        int s;
  934 -        PRINTQ( stderr, "It seems that you do not have 'cpufreq_userspace' module loaded in your kernel\n");
  935 -        PRINTQ( stderr, "I try to call \"/sbin/modprobe cpufreq_userspace\"\n");
  936 -
  937 -        /* ugly.. but very fast */
  938 -        s = system( "/sbin/modprobe cpufreq_userspace" );
  939 -
  940 -        if( s == 0 )
  941 -            PRINTQ( stderr, "..good.\n" );
  942 -        else
  943 -        {
  944 -            PRINTQ( stderr, "you should do it by yourself (maybe you need to recompile kernel ?)\n");
  945 -            return;
  946 -        }
  947 -    }
  948 -    
  949 -    /* All ok here */
  950 -    if( ( sysfp = fopen( scaling_governor_path, "w" )) == NULL ) 
  951 -        PRINTQ( stderr, error_msg, scaling_governor_path, strerror(errno));
  952 -    else
  953 -    {
  954 -        PRINTQ( stderr, "echoing 'userspace' > '%s'\n", scaling_governor_path );
  955 -        fprintf( sysfp, "userspace" );
  956 -        fclose( sysfp );
  957 -    }
  958 -
  959 -    return;
  960 -}
  961 -	
  962 -
  963  
  964  /* riempe la struttura cpuState tenendo anche conto
  965   * degli argomenti passati da linea di comando */
  966 @@ -293,7 +219,6 @@
  967  	/* auto_freq_state */
  968  	cpuState.auto_freq_state = ( args_autoFreq == AUTOFREQ_ON );
  969  	
  970 -	
  971  	/* min freq */
  972  	if( (fp = fopen( paths[0][idx[0]], "r" )) == NULL ) {
  973  		fprintf( stderr, "Error reading the info file (%s):\n%s\n", paths[0][idx[0]], strerror(errno) );
  974 @@ -313,21 +238,12 @@
  975  	
  976  	fgets ( red, 10, fp );
  977  	cpuState.maxFreq = atoi ( red );
  978 -	
  979  	fclose ( fp );
  980  	
  981  	/* set freq file */
  982  	cpuState.setFreqFile = paths[2][idx[2]];
  983  
  984 -        /* if we have to use the SYS's way to set cpufreq, then ensure that in
  985 -         * scaling_governor there has been put 'userspace'; otherwise let's try
  986 -         * to put it by ourself */
  987 -        if( idx[2] == 0 )
  988 -            scalingGovernorHelper( );
  989 -
  990 -	
  991 -        cpuReadFreq( );
  992 -	
  993 +	cpuReadFreq();
  994  	
  995          /* set freq */
  996          cpuState.setFreq = cpuState.actualFreq;
  997 @@ -336,6 +252,7 @@
  998          /* step freq */
  999          cpuState.stepFreq = args_incrementalStep;
 1000  	
 1001 +	
 1002  #else
 1003          /* init and get first actual frequency */
 1004          /* PENDING: get these files from config */
 1005 @@ -377,8 +294,7 @@
 1006  		free_and_exit( ERROR );
 1007  	}
 1008  #endif
 1009 -	switch( args_startingFreq )
 1010 -	{
 1011 +	switch( args_startingFreq ){
 1012  		case STARTINGFREQ_MIN:
 1013  #ifndef LONGRUN	
 1014  			/* frequence at min */
 1015 @@ -398,14 +314,16 @@
 1016  #endif
 1017  	}
 1018  	
 1019 +	
 1020  #ifndef LONGRUN	
 1021  #ifdef DEBUG
 1022  	fprintf ( stderr, "min freq: %d\nmax freq: %d\nactual freq: %d\n", cpuState.minFreq, cpuState.maxFreq, cpuState.actualFreq );
 1023  #endif
 1024  #else
 1025  	fprintf ( stderr, "LongRun CPU starts at %d, with autoadjust = %d\n\n", cpuState.setLevelIdx, cpuState.auto_freq_state );
 1026 -        cpuEchoFreq();  /* set initial range */
 1027 +//        cpuEchoFreq();  /* set initial range */
 1028  #endif
 1029 +
 1030  	return;
 1031  }
 1032  
 1033 diff -Nru wmlaptop-1.4-orig/src/main.c wmlaptop-1.4/src/main.c
 1034 --- wmlaptop-1.4-orig/src/main.c	2008-04-18 21:55:54.497550614 +0300
 1035 +++ wmlaptop-1.4/src/main.c	2008-04-18 22:08:44.250548770 +0300
 1036 @@ -29,6 +29,8 @@
 1037  
 1038  /* command line's args */
 1039         u_int32 args_cpuUpdate        = ARGSDEF_LEAVE;
 1040 +       u_int32 args_powerUpdate      = ARGSDEF_LEAVE;
 1041 +       u_int32 args_tempUpdate       = ARGSDEF_LEAVE;
 1042         u_int32 args_batteryUpdate    = ARGSDEF_LEAVE;
 1043         char *  args_XDisplayName     = NULL;
 1044         bool    args_autoFreq         = ARGSDEF_LEAVE;
 1045 @@ -52,6 +54,9 @@
 1046         bool    args_dontBlink100     = ARGSDEF_DONTBLINK100;
 1047         bool    args_ttyMode          = ARGSDEF_LEAVE;
 1048  	   bool    args_skin             = ARGSDEF_LEAVE;
 1049 +       int     governor              = 2; // 1=userspace 2=ondemand
 1050 +       double  powerrate             = 1;
 1051 +       double  capacity;
 1052  
 1053  /* X's stuff */
 1054  struct mouseRegion mouse_region[MAX_MOUSE_REGION];
 1055 @@ -106,8 +111,13 @@
 1056  		}
 1057  	}
 1058  	
 1059 -	init_cpuState (  );
 1060 -    powerState.updater();
 1061 +	if (governor == 1){
 1062 +		init_cpuState();
 1063 +	}
 1064 +	battery_capacity();
 1065 +	cpuReadTemp();
 1066 +	print_battery();
 1067 +	
 1068  	
 1069      if( args_ttyMode ) {
 1070          fprintf( stdout, "\n" );
 1071 @@ -119,6 +129,7 @@
 1072      }
 1073      else
 1074      {
 1075 +	    if (governor == 1){
 1076          /* auto-freq mouse region */
 1077          AddMouseRegion( MREGION_AUTOFREQ, 7, 36, 55, 46 );
 1078          /* cpu frequency left arrow */
 1079 @@ -126,6 +137,9 @@
 1080          /* cpu frequency right arrow */
 1081          AddMouseRegion( MREGION_MAXFREQ, 55, 52, 58, 59 );
 1082      }	
 1083 +
 1084 +    }
 1085 +
 1086  	event_handler (  );
 1087  
 1088  	
 1089 @@ -204,9 +218,13 @@
 1090  	fprintf( stderr, "                                v - victory jingle\n");
 1091  	fprintf( stderr, "                                h - high-bell sounds\n");	
 1092  	fprintf( stderr, "   --alarm-repeat=N           repeat the choosen alarm N times\n");
 1093 +	fprintf( stderr, "[KERNEL-related-options]:\n");
 1094 +	fprintf( stderr, "   --governor=ondemand|userspace choose cpu scaling governor\n");
 1095  	fprintf( stderr, "[GENERAL-options]:\n");
 1096  	fprintf( stderr, "   --cpu-update=N             how often, in milliseconds, to update CPU display\n");
 1097 -	fprintf( stderr, "   --battery-update=N         how often, in milliseconds, update battery state\n");
 1098 +	fprintf( stderr, "   --battery-update=N         how often, in seconds, to update battery state\n");
 1099 +	fprintf( stderr, "   --power-update=N           how often, in seconds, to update power state\n");
 1100 +	fprintf( stderr, "   --temperature-update=N     how often, in seconds, to update temperature state\n");
 1101  	fprintf( stderr, "   -p   --play                play alarm and exit\n");
 1102  	fprintf( stderr, "   -q   --quiet               do not print messages and warnings\n");
 1103  	fprintf( stderr, "   -d   --default             show the default compiled settings and exit\n");
 1104 @@ -318,6 +336,14 @@
 1105  			args_startingFreq = STARTINGFREQ_MAX;
 1106  			continue;
 1107  		}
 1108 +		if( !strcmp( argv[i], "--governor=ondemand" ) ) {
 1109 +			governor=2;
 1110 +			continue;
 1111 +		}
 1112 +		if( !strcmp( argv[i], "--governor=userspace" ) ) {
 1113 +			governor=1;
 1114 +			continue;
 1115 +		}
 1116  		
 1117  		if( !strncmp( argv[i], "--max-freq=", 11 ) ) {
 1118  			EXIT_IF_ALREADY_SET( args_maxFreq, ARGSDEF_LEAVE, "maxFreq" );
 1119 @@ -465,7 +491,7 @@
 1120  			ptr = strchr( argv[i], '=' );
 1121  			ptr++;
 1122  			args_cpuUpdate = atoi( ptr );
 1123 -			WARNING_IS_SET_TO_ZERO( args_maxFreq, "cpuUpdate" );
 1124 +			WARNING_IS_SET_TO_ZERO( args_cpuUpdate, "cpuUpdate" );
 1125  			continue;
 1126  		}
 1127  		
 1128 @@ -474,7 +500,25 @@
 1129  			ptr = strchr( argv[i], '=' );
 1130  			ptr++;
 1131  			args_batteryUpdate = atoi( ptr );
 1132 -			WARNING_IS_SET_TO_ZERO( args_maxFreq, "batteryUpdate" );
 1133 +			WARNING_IS_SET_TO_ZERO( args_batteryUpdate, "batteryUpdate" );
 1134 +			continue;
 1135 +		}
 1136 +		
 1137 +		if( !strncmp( argv[i], "--power-update=", 11 ) ) {
 1138 +			EXIT_IF_ALREADY_SET( args_powerUpdate, ARGSDEF_LEAVE, "powerUpdate" );
 1139 +			ptr = strchr( argv[i], '=' );
 1140 +			ptr++;
 1141 +			args_powerUpdate = atoi( ptr );
 1142 +			WARNING_IS_SET_TO_ZERO( args_powerUpdate, "powerUpdate" );
 1143 +			continue;
 1144 +		}
 1145 +		
 1146 +		if( !strncmp( argv[i], "--temperature-update=", 11 ) ) {
 1147 +			EXIT_IF_ALREADY_SET( args_tempUpdate, ARGSDEF_LEAVE, "tempUpdate" );
 1148 +			ptr = strchr( argv[i], '=' );
 1149 +			ptr++;
 1150 +			args_tempUpdate = atoi( ptr );
 1151 +			WARNING_IS_SET_TO_ZERO( args_tempUpdate, "tempUpdate" );
 1152  			continue;
 1153  		}
 1154  		
 1155 @@ -511,6 +555,8 @@
 1156  	/* setting default values not set by command line */
 1157  	SET_DEFAULT( args_cpuUpdate,       ARGSDEF_LEAVE,      ARGSDEF_CPUUPDATE );
 1158  	SET_DEFAULT( args_batteryUpdate,   ARGSDEF_LEAVE,      ARGSDEF_BATTERYUPDATE );
 1159 +	SET_DEFAULT( args_powerUpdate,     ARGSDEF_LEAVE,      ARGSDEF_POWERUPDATE );
 1160 +	SET_DEFAULT( args_tempUpdate,      ARGSDEF_LEAVE,      ARGSDEF_TEMPUPDATE );
 1161  	SET_DEFAULT( args_XDisplayName,    NULL,               ARGSDEF_XDISPLAYNAME );
 1162  	SET_DEFAULT( args_autoFreq,        ARGSDEF_LEAVE,      ARGSDEF_AUTOFREQ );
 1163  	SET_DEFAULT( args_incrementalStep, ARGSDEF_LEAVE,      ARGSDEF_INCREMENTALSTEP );
 1164 @@ -566,6 +612,8 @@
 1165  	fprintf( stdout, "   --skin=%d\n", ARGSDEF_SKIN );
 1166  	fprintf( stdout, "[CPU-options]:\n");
 1167  	fprintf( stdout, "   --cpu-update=%d\n", ARGSDEF_CPUUPDATE );
 1168 +	fprintf( stdout, "   --temperature-update=%d\n", ARGSDEF_TEMPUPDATE );
 1169 +	fprintf( stdout, "   --power-update=%d\n", ARGSDEF_POWERUPDATE );
 1170  	fprintf( stdout, "   --auto-freq=%s\n", ARGSDEF_AUTOFREQ == AUTOFREQ_ON ? "on" : "off" );
 1171  	fprintf( stdout, "   --incremental-step=%d\n", ARGSDEF_INCREMENTALSTEP );
 1172  	if( ARGSDEF_STARTINGFREQ != ARGSDEF_LEAVE )
 1173 diff -Nru wmlaptop-1.4-orig/src/main.h wmlaptop-1.4/src/main.h
 1174 --- wmlaptop-1.4-orig/src/main.h	2008-04-18 21:55:54.497550614 +0300
 1175 +++ wmlaptop-1.4/src/main.h	2008-04-18 21:56:45.010548403 +0300
 1176 @@ -134,7 +134,7 @@
 1177  	u_int8  counter;
 1178  	char    stateFile[52];
 1179  	char    infoFile[52];
 1180 -	u_int32 capacity;
 1181 +	double  capacity;
 1182  	u_int32 actualState;
 1183  	u_int16 percentage;
 1184  	bool    useLFC;
 1185 @@ -175,9 +175,12 @@
 1186  	u_int8        percentage;
 1187  	u_int16       remainingTime;
 1188  	bool          isCharging;
 1189 +//	double        rate;
 1190  	void(*updater)();
 1191  };
 1192  
 1193 +extern double powerrate;
 1194 +extern double capacity;
 1195  
 1196  /*******************
 1197   * CPUS' STUFF     *
 1198 @@ -192,6 +195,7 @@
 1199   * events cycle.                                                 *
 1200   *****************************************************************/
 1201  extern        u_int8  cpuLoad;
 1202 +extern        int governor;
 1203  
 1204  /*****************************************************************
 1205   * global variable cpuState is a structure of this type, it      *
 1206 @@ -224,6 +228,7 @@
 1207  	char *  setFreqFile;
 1208  	u_int32 setFreq;
 1209  	u_int32 stepFreq;
 1210 +	int     Temp;
 1211  #else
 1212          u_int16 *longRunLevels;
 1213          u_int16 nLongRunLevels;
 1214 @@ -337,14 +342,22 @@
 1215  
 1216  /* update frequencies, in milliseconds; cpu must < battery */
 1217  #ifndef    ARGSDEF_CPUUPDATE
 1218 -# define    ARGSDEF_CPUUPDATE         80
 1219 +# define    ARGSDEF_CPUUPDATE         400
 1220  #endif
 1221  #ifndef    ARGSDEF_BATTERYUPDATE
 1222 -# define    ARGSDEF_BATTERYUPDATE     5000
 1223 +# define    ARGSDEF_BATTERYUPDATE     30 // seconds
 1224 +#endif
 1225 +#ifndef    ARGSDEF_POWERUPDATE
 1226 +# define    ARGSDEF_POWERUPDATE     5 // seconds
 1227 +#endif
 1228 +#ifndef    ARGSDEF_TEMPUPDATE
 1229 +# define    ARGSDEF_TEMPUPDATE     10 // seconds
 1230  #endif
 1231  
 1232  extern u_int32 args_cpuUpdate;
 1233  extern u_int32 args_batteryUpdate;
 1234 +extern u_int32 args_powerUpdate;
 1235 +extern u_int32 args_tempUpdate;
 1236  
 1237  /* name of diplay to open */
 1238  #ifndef    ARGSDEF_XDISPLAYNAME
 1239 @@ -363,7 +376,7 @@
 1240  
 1241  /* incremental auto-scaling step */
 1242  #ifndef    ARGSDEF_INCREMENTALSTEP
 1243 -# define    ARGSDEF_INCREMENTALSTEP   100000
 1244 +# define    ARGSDEF_INCREMENTALSTEP   200000
 1245  #endif
 1246  extern u_int32 args_incrementalStep;
 1247  
 1248 @@ -395,7 +408,7 @@
 1249  #define    PARADISIAC_OFF             2
 1250  
 1251  #ifndef    ARGSDEF_PARADISIAC
 1252 -# define    ARGSDEF_PARADISIAC        PARADISIAC_ON
 1253 +# define    ARGSDEF_PARADISIAC        PARADISIAC_OFF
 1254  #endif
 1255  extern bool    args_paradisiac;
 1256  
 1257 diff -Nru wmlaptop-1.4-orig/src/pixmap.c wmlaptop-1.4/src/pixmap.c
 1258 --- wmlaptop-1.4-orig/src/pixmap.c	2008-04-18 21:55:54.497550614 +0300
 1259 +++ wmlaptop-1.4/src/pixmap.c	2008-04-18 21:56:45.012548584 +0300
 1260 @@ -18,9 +18,235 @@
 1261  
 1262  char ** wmlaptop_xpm = NULL;
 1263  
 1264 +/* XPM */
 1265 +static char * wmlaptop_xpm_type0[] = {
 1266 +"123 140 81 1",
 1267 +" 	c None",
 1268 +".	c #FF0000",
 1269 +"+	c #000000",
 1270 +"@	c #00FF04",
 1271 +"#	c #968E8E",
 1272 +"$	c #FFFF00",
 1273 +"%	c #FF1700",
 1274 +"&	c #FF2F00",
 1275 +"*	c #FF4700",
 1276 +"=	c #FF5F00",
 1277 +"-	c #FF7700",
 1278 +";	c #FF8E00",
 1279 +">	c #FFA600",
 1280 +",	c #FFBE00",
 1281 +"'	c #FFD600",
 1282 +")	c #FFEE00",
 1283 +"!	c #FFF900",
 1284 +"~	c #F4FA00",
 1285 +"{	c #DFFA00",
 1286 +"]	c #C9FB00",
 1287 +"^	c #B4FB00",
 1288 +"/	c #9FFC00",
 1289 +"(	c #89FD00",
 1290 +"_	c #74FD00",
 1291 +":	c #5EFE00",
 1292 +"<	c #49FE00",
 1293 +"[	c #3FFF00",
 1294 +"}	c #050500",
 1295 +"|	c #EFEC19",
 1296 +"1	c #242303",
 1297 +"2	c #B1AF13",
 1298 +"3	c #262504",
 1299 +"4	c #ECE919",
 1300 +"5	c #060600",
 1301 +"6	c #94920F",
 1302 +"7	c #E7E418",
 1303 +"8	c #6F6D0B",
 1304 +"9	c #ABA912",
 1305 +"0	c #67660B",
 1306 +"a	c #020200",
 1307 +"b	c #F3F01A",
 1308 +"c	c #0F0F01",
 1309 +"d	c #6A690B",
 1310 +"e	c #A2A011",
 1311 +"f	c #86850E",
 1312 +"g	c #191902",
 1313 +"h	c #101001",
 1314 +"i	c #8C8B0F",
 1315 +"j	c #605F0A",
 1316 +"k	c #AAA812",
 1317 +"l	c #2A2904",
 1318 +"m	c #FBF81B",
 1319 +"n	c #383706",
 1320 +"o	c #AEAC12",
 1321 +"p	c #525108",
 1322 +"q	c #E0DD18",
 1323 +"r	c #222203",
 1324 +"s	c #161602",
 1325 +"t	c #E8E518",
 1326 +"u	c #5B5A09",
 1327 +"v	c #F5F21A",
 1328 +"w	c #63620A",
 1329 +"x	c #E5E218",
 1330 +"y	c #0B0B01",
 1331 +"z	c #F8F51A",
 1332 +"A	c #C6C415",
 1333 +"B	c #BCB914",
 1334 +"C	c #999710",
 1335 +"D	c #C1BF14",
 1336 +"E	c #AFAD12",
 1337 +"F	c #7C7A0D",
 1338 +"G	c #F7F41A",
 1339 +"H	c #272604",
 1340 +"I	c #5F5E0A",
 1341 +"J	c #181802",
 1342 +"K	c #0E0E01",
 1343 +"L	c #313005",
 1344 +"M	c #C4C215",
 1345 +"N	c #DCD917",
 1346 +"O	c #131302",
 1347 +"P	c #6D6B0B",
 1348 +"                                                                ...........................................................",
 1349 +"                                                                ...........................................................",
 1350 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1351 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1352 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1353 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1354 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1355 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1356 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1357 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1358 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.........+++....+++......+++.............",
 1359 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++........+++++...+++......+++.............",
 1360 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++..+++......+++.............",
 1361 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++..+++......+++.............",
 1362 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++...+++....+++..............",
 1363 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++...+++....+++..............",
 1364 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++...+++....+++..............",
 1365 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++...+++....+++..............",
 1366 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++...+++.++.+++..............",
 1367 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++...+++.++.+++..............",
 1368 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++....++.++.++...............",
 1369 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++....++.++.++...............",
 1370 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++....++.++.++...............",
 1371 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++.......+++.+++....++.++.++...............",
 1372 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++++++...+++.+++.....++..++................",
 1373 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++++++....+++++......++..++................",
 1374 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...............+++++++.....+++.......++..++................",
 1375 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1376 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1377 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1378 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1379 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1380 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1381 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1382 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++.....+++...+++++++.+++++++.+++++.+++++....+++.+++...",
 1383 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++....+++++..+++++++.+++++++.+++++.+++++++..+++.+++...",
 1384 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++++.+++++++.+++++++.+++++++.+++++.+++++++..+++.+++...",
 1385 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++++++...+++.....+++...+++...+++.++++.+++.+++...",
 1386 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++.+++...+++.....+++...+++...+++..+++.+++.+++...",
 1387 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++.+++...+++.....+++...+++...+++.++++.+++.+++...",
 1388 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++.+++...+++.....+++...+++...+++.+++..+++.+++...",
 1389 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++++.+++.+++...+++.....+++...++++..+++++++..+++.+++...",
 1390 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..++++++..+++++++...+++.....+++...++++..+++++....+++++++...",
 1391 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++++.+++++++...+++.....+++...++++..+++++.....+++++....",
 1392 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++++++...+++.....+++...+++...++++++....+++++....",
 1393 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++.+++...+++.....+++...+++...++++++.....+++.....",
 1394 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++.+++...+++.....+++...+++...+++++++....+++.....",
 1395 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++.+++.+++.+++...+++.....+++...+++...+++.+++....+++.....",
 1396 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++++.+++.+++...+++.....+++...+++++.+++.++++...+++.....",
 1397 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++...+++.+++...+++.....+++...+++++.+++..+++...+++.....",
 1398 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ..+++++...+++.+++...+++.....+++...+++++.+++..+++...+++.....",
 1399 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1400 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1401 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1402 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1403 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1404 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1405 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1406 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   ...........................................................",
 1407 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1408 +"  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1409 +"                                                                +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1410 +"                                                                +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1411 +"                                                                +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1412 +"+@@+++@++@@+@@@+@+++@@@++@@+@@@@+@@++@@++@++++@++++###+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1413 +"@++@+@@+@++@+++@@+++@+++@++++++@@++@@++@@+@++@++++#++###+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1414 +"@++@@+@+@++@+++@@+++@+++@++++++@@++@@++@+@++@++++#+++#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1415 +"@++@++@+++@++@@+@+++@@@+@@@++++@+@@++@@@+++@++++#+#++###+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1416 +"@++@++@++@+++++@@+@++++@@++@++@+@++@+++@++@++@+#+++###+++++++++++++++++++++++++$$$+++++++++$$$++++$$$++++++$$$+++++++++++++",
 1417 +"@++@++@+@++++++@@@@@+++@@++@++@+@++@+++@+@++@+@#+++++++++++++++++++++++++++++++$$$++++++++$$$$$+++$$$++++++$$$+++++++++++++",
 1418 +"+@@+@@@@@@@@@@@+++@+@@@++@@+++@++@@++@@+@++++@+++++@@@+++......++++++++++++++++$$$+++++++$$$+$$$++$$$++++++$$$+++++++++++++",
 1419 +"+$$+++$++$$+$$$+$+++$$$++$$+$$$$+$$++$$++$++++$+++@++@@@+++++++++++++++++++++++$$$+++++++$$$+$$$++$$$++++++$$$+++++++++++++",
 1420 +"$++$+$$+$++$+++$$+++$+++$++++++$$++$$++$$+$++$+++@+++@+++++++++++++++++++++++++$$$+++++++$$$+$$$+++$$$++++$$$++++++++++++++",
 1421 +"$++$$+$+$++$+++$$+++$+++$++++++$$++$$++$+$++$+++@+@++@@@+++++++++++++++++++++++$$$+++++++$$$+$$$+++$$$++++$$$++++++++++++++",
 1422 +"$++$++$+++$++$$+$+++$$$+$$$++++$+$$++$$$+++$+++@+++@@@+++++++++++++++++++++++++$$$+++++++$$$+$$$+++$$$++++$$$++++++++++++++",
 1423 +"$++$++$++$+++++$$+$++++$$++$++$+$++$+++$++$++$+@+++++++++++++++++++++++++++++++$$$+++++++$$$+$$$+++$$$++++$$$++++++++++++++",
 1424 +"$++$++$+$++++++$$$$$+++$$++$++$+$++$+++$+$++$+$++++++++++++++++++++++++++++++++$$$+++++++$$$+$$$+++$$$+$$+$$$++++++++++++++",
 1425 +"+$$+$$$$$$$$$$$+++$+$$$++$$+++$++$$++$$+$++++$+++++$$++++++++++++++++++++++++++$$$+++++++$$$+$$$+++$$$+$$+$$$++++++++++++++",
 1426 +"+..+++.++..+...+.+++...++..+....+..++..++.++++.+++$$$$+++++++++++++++++++++++++$$$+++++++$$$+$$$++++$$+$$+$$+++++++++++++++",
 1427 +".++.+..+.++.+++..+++.+++.++++++..++..++..+.++.+++$$$$$$++++++++++++++++++++++++$$$+++++++$$$+$$$++++$$+$$+$$+++++++++++++++",
 1428 +".++..+.+.++.+++..+++.+++.++++++..++..++.+.++.+++$$$$$$$$+++++++++++++++++++++++$$$+++++++$$$+$$$++++$$+$$+$$+++++++++++++++",
 1429 +".++.++.+++.++..+.+++...+...++++.+..++...+++.+++++$$$$$$++++++++++++++++++++++++$$$+++++++$$$+$$$++++$$+$$+$$+++++++++++++++",
 1430 +".++.++.++.+++++..+.++++..++.++.+.++.+++.++.++.++++$$$$+++++++++++++++++++++++++$$$$$$$+++$$$+$$$+++++$$++$$++++++++++++++++",
 1431 +".++.++.+.++++++.....+++..++.++.+.++.+++.+.++.+.++++$$++++++++++++++++++++++++++$$$$$$$++++$$$$$++++++$$++$$++++++++++++++++",
 1432 +"+..+...........+++.+...++..+++.++..++..+.++++.+++++++++++++++++++++++++++++++++$$$$$$$+++++$$$+++++++$$++$$++++++++++++++++",
 1433 +"+@@@@++++@+++@@@@+@@@@+++++@++@@@@@++@@@@+@@@@@@+@@@@++@@@@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1434 +"@++++@++@@++@++++@++++@++++@++@+++++@+++++@++++@@++++@@++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1435 +"@++++@+@+@++@++++@+++++@++@+++@+++++@++++++++++@@++++@@++++@#.@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1436 +"@++++@@++@+++++++@+++++@++@+++@+++++@++++++++++@@++++@@++++@#.@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1437 +"@++++@+++@++++++@+++@@@++@++++@@@@++@@@@@+++++@++@@@@++@@@@@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1438 +"@++++@+++@+++++@++++++@++@++++++++@+@++++@++++@+@++++@+++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1439 +"@++++@+++@++++@++++++++@@++@+++++++@@++++@+++@++@++++@+++++@#.@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1440 +"@++++@+++@+++@+++++++++@@@@@@@+++++@@++++@+++@++@++++@+++++@#.@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1441 +"@++++@+++@++@+++++++++@++++@++++++@+@++++@+++@++@++++@+++++@++++++$$$$$+++++$$$+++$$$$$$$+$$$$$$$+$$$$$+$$$$$++++$$$+$$$+++",
 1442 +"+@@@@+@@@@@@@@@@@@@@@@+++++@++@@@@+++@@@@++++@+++@@@@++@@@@+++++++$$$$$++++$$$$$++$$$$$$$+$$$$$$$+$$$$$+$$$$$$$++$$$+$$$+++",
 1443 +"..................................................%&*=-;>,')++++++$$$$$$$+$$$$$$$+$$$$$$$+$$$$$$$+$$$$$+$$$$$$$++$$$+$$$+++",
 1444 +".+++++++++++++++++++++++++++++++++++++++++++++++..%&*=-;>,')++++++$$$+$$$+$$$$$$$+++$$$+++++$$$+++$$$+++$$$+$$$$+$$$+$$$+++",
 1445 +".+++.+++.++.+.....++..++++++....+...++....++..++..%&*=-;>,')++++++$$$+$$$+$$$+$$$+++$$$+++++$$$+++$$$+++$$$++$$$+$$$+$$$+++",
 1446 +".+++.+++.++.+++.+++.++.+++++.++++.++.+.++++.++.+..%&*=-;>,')++++++$$$+$$$+$$$+$$$+++$$$+++++$$$+++$$$+++$$$+$$$$+$$$+$$$+++",
 1447 +".++.+.++.++.+++.+++.++.+++++.++++.++.+.++++.++.+..%&*=-;>,')++++++$$$+$$$+$$$+$$$+++$$$+++++$$$+++$$$+++$$$+$$$++$$$+$$$+++",
 1448 +".++.+.++.++.+++.+++.++.+...+...++...++...++.++.+..%&*=-;>,')++++++$$$$$$$+$$$+$$$+++$$$+++++$$$+++$$$$++$$$$$$$++$$$+$$$+++",
 1449 +".+.....+.++.+++.+++.++.+++++.++++.++.+.++++..+.+..%&*=-;>,')++++++$$$$$$++$$$$$$$+++$$$+++++$$$+++$$$$++$$$$$++++$$$$$$$+++",
 1450 +".+.+++.+.++.+++.+++.++.+++++.++++.++.+.++++.+..+.!~{]^/(_:<[++++++$$$$$$$+$$$$$$$+++$$$+++++$$$+++$$$$++$$$$$+++++$$$$$++++",
 1451 +".+.+++.++..++++.++++..++++++.++++.++.+....++...+.!~{]^/(_:<[++++++$$$+$$$+$$$$$$$+++$$$+++++$$$+++$$$+++$$$$$$++++$$$$$++++",
 1452 +".+++++++++++++++++++++++++++++++++++++++++++++++.!~{]^/(_:<[++++++$$$+$$$+$$$+$$$+++$$$+++++$$$+++$$$+++$$$$$$+++++$$$+++++",
 1453 +".................................................!~{]^/(_:<[++++++$$$+$$$+$$$+$$$+++$$$+++++$$$+++$$$+++$$$$$$$++++$$$+++++",
 1454 +"#################################################!~{]^/(_:<[++++++$$$+$$$+$$$+$$$+++$$$+++++$$$+++$$$+++$$$+$$$++++$$$+++++",
 1455 +"#+++++++++++++++++++++++++++++++++++++++++++++++#!~{]^/(_:<[++++++$$$$$$$+$$$+$$$+++$$$+++++$$$+++$$$$$+$$$+$$$$+++$$$+++++",
 1456 +"#+++#+++#++#+#####++##++++++####+###++####++##++#!~{]^/(_:<[++++++$$$$$+++$$$+$$$+++$$$+++++$$$+++$$$$$+$$$++$$$+++$$$+++++",
 1457 +"#+++#+++#++#+++#+++#++#+++++#++++#++#+#++++#++#+#++++##+++++++++++$$$$$+++$$$+$$$+++$$$+++++$$$+++$$$$$+$$$++$$$+++$$$+++++",
 1458 +"#++#+#++#++#+++#+++#++#+++++#++++#++#+#++++#++#+#+++####+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1459 +"#++#+#++#++#+++#+++#++#+###+###++###++###++#++#+#++######++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1460 +"#+#####+#++#+++#+++#++#+++++#++++#++#+#++++##+#+#+########+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1461 +"#+#+++#+#++#+++#+++#++#+++++#++++#++#+#++++#+##+#++######++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1462 +"#+#+++#++##++++#++++##++++++#++++#++#+####++###+#+++####+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1463 +"#+++++++++++++++++++++++++++++++++++++++++++++++#++++##++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1464 +"#################################################++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1465 +"+$$$+$$$++$++$++$+++++$$$++++$+++$$$+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1466 +"$++++$++$+$++$++$++++$+++$+++$+++$++$++####+++++++++++++++++++++  #######################################################  ",
 1467 +"$++++$++$+$++$++$++++$+++$++$+$++$++$+#++++#++@+++@+@++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1468 +"$++++$$$++$++$++$++++$+++$++$+$++$++$+#++++#++@@+@@+@++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1469 +"$++++$++++$++$++$++++$+++$+$$$$$+$++$+#++++#++@@@@@+@++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1470 +"$++++$++++$++$++$++++$+++$+$+++$+$++$+#++++#++@+@+@+@@@@+@@@@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1471 +"+$$$+$+++++$$+++$$$$++$$$++$+++$+$$$++#++++#++@+++@+@@@@++++@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1472 +"+...+...++.++.++.+++++...++++.+++...++#++++#++@+++@+@++@+++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1473 +".++++.++.+.++.++.++++.+++.+++.+++.++.+#++++#++@+++@+@++@+++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1474 +".++++.++.+.++.++.++++.+++.++.+.++.++.+#++++#++@+++@+@++@++@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1475 +".++++...++.++.++.++++.+++.++.+.++.++.++####+++@+++@+@++@+@@@@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1476 +".++++.++++.++.++.++++.+++.+.....+.++.++++++++++++++++++++++++++++}+++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1477 +".++++.++++.++.++.++++.+++.+.+++.+.++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1478 +"+...+.+++++..+++....++...++.+++.+...++++++++++++++++++++++++++++++++++@+++++++@++.+++++++.+++++++++++++++++++++++++++++++++",
 1479 +"#############################################                   ++++++@+++++++@++.+++++++.+++++++++++++++++++++++++++++++++",
 1480 +"#+++++++++++++++++++++++++++++++++++++++++++#                   ++++++@+++++++@++.+++++++.+++++++++++++++++++++++++++++++++",
 1481 +"#+++++++++++++++++++++++++++++++++++++++++++#                   ++++++@+++++++@++.+++++++.+++++++++++++++++++++++++++++++++",
 1482 +"#+++++++++++++++++++++++++++++++++++++++++++#                   ++++++@+++@+++@++.+++.+++.+++++++++++++++++++++++++++++++++",
 1483 +"#+++++++++++++++++++++++++++++++++++++++++++#                   ++++++@@+@@@+@@++..+...+..+++++++++++++++++++++++++++++++++",
 1484 +"#+++++++++++++++++++++++++++++++++++++++++++#                   +++++++@@+++@@++++..+++..++++++++++++++++++++++++++++++++++",
 1485 +"#+++++++++++++++++++++++++++++++++++++++++++#                   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1486 +"#+++++++++++++++++++++++++++++++++++++++++++#                   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1487 +"#############################################                                                                              "};
 1488 +
 1489 +
 1490  
 1491  /* XPM */
 1492 -char * wmlaptop_xpm_type0[] = {
 1493 +/*char * wmlaptop_xpm_type0[] = {
 1494  "123 140 27 1",
 1495  " 	c None",
 1496  ".	c #FF0000",
 1497 @@ -190,7 +416,7 @@
 1498  "#+++++++++++++++++++++++++++++++++++++++++++#                   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
 1499  "#############################################                                                                              "};
 1500  
 1501 -
 1502 +*/
 1503  
 1504  
 1505  /* XPM */
 1506 diff -Nru wmlaptop-1.4-orig/src/version.h wmlaptop-1.4/src/version.h
 1507 --- wmlaptop-1.4-orig/src/version.h	2008-04-18 21:55:54.497550614 +0300
 1508 +++ wmlaptop-1.4/src/version.h	2008-04-18 21:56:45.012548584 +0300
 1509 @@ -1,7 +1,7 @@
 1510  #ifndef __VERSION_H__
 1511  #define __VERSION_H__
 1512  
 1513 -#define    BUILD_NR       256
 1514 +#define    BUILD_NR       495
 1515  #define    PROGNAME       "WmLaptop"
 1516  #define    VERSION        "1.4"
 1517  

Generated by cgit