actuallymentor / battery

CLI/GUI for managing the battery charging status for Apple silicon (M1, M32, M3) Macs
MIT License
3.58k stars 148 forks source link

Question: How does this work? #212

Closed Tydox closed 8 months ago

Tydox commented 9 months ago

What is the issue? (required) Hello, I would like to know how this app works, how does it exactly limit the charge? I applaud all of you guys for your hard work!!

But prior to installing it, I would like to know what's under the hood, I saw other apps that make lots of low level changes, but it didn't make sense, as M1 does not have smc but they said they are writing to the smc, so I was skeptical.

I couldn't find in the readme an explanation so I am asking here. sorry if its not the right place. I'd appriciate if one of the devs could give a short explanation. 🙏 Thanks.

actuallymentor commented 8 months ago

Happy to help @Tydox!

We do use the smc CLI, build from this repository.

Honestly, I am not enough of a hardware guy to understand the nuances of what is and is not an SMC chip, but we use the zsmc` CLI to set keys to the SMC equivalent that M* chip devices have.

You can view with which commands here in the source. Since the CLI is pure shell scripting, it should be easy to read.

Quick call to action: if you understand hardware better than I and after seeing the source you know how to properly describe what is happening under the hood, I would love a pull request for the README.md explaining the nuances so that future people like you have a place to read up in the underlying tech.

Feel free to re-open this issue if you have further questions!