variable names
This commit is contained in:
parent
cc85bcc4a4
commit
570ebe3496
10
slstatus.c
10
slstatus.c
@ -39,7 +39,7 @@ setstatus(char *str)
|
|||||||
char *
|
char *
|
||||||
battery()
|
battery()
|
||||||
{
|
{
|
||||||
int batt_now, batt_full, batt_perc;
|
int battery_now, battery_full, battery_perc;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
/* open battery now file */
|
/* open battery now file */
|
||||||
@ -49,7 +49,7 @@ battery()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* read value */
|
/* read value */
|
||||||
fscanf(fp, "%i", &batt_now);
|
fscanf(fp, "%i", &battery_now);
|
||||||
|
|
||||||
/* close battery now file */
|
/* close battery now file */
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -61,16 +61,16 @@ battery()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* read value */
|
/* read value */
|
||||||
fscanf(fp, "%i", &batt_full);
|
fscanf(fp, "%i", &battery_full);
|
||||||
|
|
||||||
/* close battery full file */
|
/* close battery full file */
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
/* calculate percent */
|
/* calculate percent */
|
||||||
batt_perc = batt_now / (batt_full / 100);
|
battery_perc = battery_now / (battery_full / 100);
|
||||||
|
|
||||||
/* return batt_perc as string */
|
/* return batt_perc as string */
|
||||||
return smprintf("%d%%", batt_perc);
|
return smprintf("%d%%", battery_perc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cpu temperature */
|
/* cpu temperature */
|
||||||
|
Loading…
Reference in New Issue
Block a user