battery states

This commit is contained in:
Jos Dehaes 2021-10-05 23:42:17 +02:00 committed by aristocratos
parent a9b64d62e4
commit 8d86011d72

View file

@ -342,6 +342,13 @@ namespace Cpu {
string p(perc);
p.resize(3);
percent = atoi(p.c_str());
if (!strstr(buf, "discharging")) {
if (percent < 100) {
status = "charging";
} else {
status = "full";
}
}
} else {
has_battery = false;
}