mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-29 16:50:20 +12:00
battery states
This commit is contained in:
parent
0ad93684c2
commit
096104c90b
|
@ -342,6 +342,13 @@ namespace Cpu {
|
||||||
string p(perc);
|
string p(perc);
|
||||||
p.resize(3);
|
p.resize(3);
|
||||||
percent = atoi(p.c_str());
|
percent = atoi(p.c_str());
|
||||||
|
if (!strstr(buf, "discharging")) {
|
||||||
|
if (percent < 100) {
|
||||||
|
status = "charging";
|
||||||
|
} else {
|
||||||
|
status = "full";
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
has_battery = false;
|
has_battery = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue