mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-16 10:22:46 +12:00
battery states
This commit is contained in:
parent
0ad93684c2
commit
096104c90b
|
@ -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