This commit is contained in:
Tony Butler 2025-06-09 01:03:12 +01:00 committed by GitHub
commit 18fa89ae02
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;
}