This commit is contained in:
Tony Butler 2025-03-26 08:27:02 +00:00 committed by GitHub
commit 3b57c88cfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;
}