Xian Nox wrote:Apparently it can't read the power and HDD temp, and data is being mysterious. This should have something to do with it:
- Code: Select all
sh: /home/code/.bin/watts: No such file or directory
Also, any way to limit it to only one desktop?
Power comes from this:
- Code: Select all
#include <stdio.h>
#define CURRENT_SYS "/sys/class/power_supply/BAT0/current_now"
#define VOLTAGE_SYS "/sys/class/power_supply/BAT0/voltage_now"
#define POWER_SYS "/sys/class/power_supply/BAT0/power_now"
FILE *fds, *fdv;
unsigned int current;
unsigned int voltage;
unsigned int power;
int main(int argc, char **argv) {
if((fds = fopen(CURRENT_SYS,"r"))) {
if((fdv = fopen(VOLTAGE_SYS,"r"))) {
fscanf(fds, "%d", ¤t);
fscanf(fdv, "%d", &voltage);
current /= 1000;
voltage /= 1000;
printf("%.2f\n", current * voltage / 1000000.0);
fclose(fdv);
}
fclose(fds);
} else {
if((fdv = fopen(POWER_SYS,"r"))) {
fscanf(fdv, "%d", &power);
printf("%.2f\n", power / 1000000.0f);
fclose(fdv);
}
}
return 0;
}
Somewhat useful on laptops, useless on desktops. HDD temperature comes from the hddtemp daemon listening on 127.0.0.1:7634, "data" just points to /mnt/data so just change every instance of it or delete the config (check settings_rings).
Never tried to limit it to one desktop but you can try messing around with the window behavior rules in systemsettings.








