Skip to content

Commit

Permalink
pause-on-battery: Support macsmc-battery driver and sysfs node
Browse files Browse the repository at this point in the history
  • Loading branch information
Spudz76 committed Jul 12, 2023
1 parent e7de104 commit 5ac6d43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/base/kernel/Platform_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5ac6d43

Please sign in to comment.