Hi polikuo
I worked out the change for you if you're interested. In the file watcher.css replace this:
static void batcheckup() {
FILE *batinfo;
sprintf(longpath, "/sys/class/power_supply/%s/charge_now", batname);
if ((batinfo = fopen(longpath, "r")) == NULL) {
fprintf(stderr, "Error opening batinfo %s\n", longpath);
exit(1);
}
fscanf(batinfo, "%f", &batnow);
fclose(batinfo);
sprintf(longpath, "/sys/class/power_supply/%s/charge_full", batname);
if ((batinfo = fopen(longpath, "r")) == NULL) {
fprintf(stderr, "Error opening batinfo %s\n", longpath);
exit(1);
}
fscanf(batinfo, "%f", &batfull);
fclose(batinfo);
sprintf(batmsg, " %.1f%%B", (float)(batnow / batfull) * 100);
}
with this:
static void batcheckup() {
FILE *batinfo;
sprintf(longpath, "/sys/class/power_supply/%s/energy_now", batname);
if ((batinfo = fopen(longpath, "r")) == NULL)
{
fprintf(stderr, "Error opening batinfo %s\n", longpath);
sprintf(longpath, "/sys/class/power_supply/%s/charge_now", batname);
if ((batinfo = fopen(longpath, "r")) == NULL)
{
fprintf(stderr, "Error opening batinfo %s\n", longpath);
exit(1);
}
}
fscanf(batinfo, "%f", &batnow);
fclose(batinfo);
sprintf(longpath, "/sys/class/power_supply/%s/energy_full", batname);
if ((batinfo = fopen(longpath, "r")) == NULL)
{
fprintf(stderr, "Error opening batinfo %s\n", longpath);
sprintf(longpath, "/sys/class/power_supply/%s/charge_full", batname);
if ((batinfo = fopen(longpath, "r")) == NULL)
{
fprintf(stderr, "Error opening batinfo %s\n", longpath);
exit(1);
}
}
fscanf(batinfo, "%f", &batfull);
fclose(batinfo);
sprintf(batmsg, " %.1f%%B", (float)(batnow / batfull) * 100);
}