pause-on-battery: Support macsmc-battery driver and sysfs node

This commit is contained in:
Tony Butler 2022-08-04 22:55:07 -05:00
parent e7de104d88
commit 5ac6d438fa

View file

@ -169,6 +169,12 @@ bool xmrig::Platform::isOnBatteryPower()
return (status == "Discharging");
}
}
std::ifstream f("/sys/class/power_supply/macsmc-battery/status");
if (f.is_open()) {
std::string status;
f >> status;
return (status == "Discharging");
}
return false;
}