mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add the "timeleft":"<seconds>" to the battery info
This commit is contained in:
@@ -43,6 +43,15 @@ QJsonObject SysInfo::batteryInfo(){
|
||||
else
|
||||
retObject.insert("status", "unknown");
|
||||
|
||||
int timeleft = General::RunCommand("apm -t").toInt(&ok);
|
||||
if ( ok ) {
|
||||
tmp.setNum(timeleft);
|
||||
retObject.insert("timeleft", tmp);
|
||||
} else {
|
||||
retObject.insert("timeleft", "-1");
|
||||
}
|
||||
|
||||
|
||||
return retObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user