mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-15 09:54:33 +12:00
battery states
This commit is contained in:
parent
a9b64d62e4
commit
8d86011d72
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue