EnerG caps your MacBook's charge from the menu bar. Once the battery reaches your limit, the Mac runs from the adapter and the battery stays put.
A free, open-source alternative to AlDente, built around just the essentials.
- Charge Limit: 50–100% in steps of 5. 100 means no limit.
- Top Up: charge to 100% once, e.g. before a trip. Ends when you unplug or stop it.
- Pause: hand charging and the LED back to macOS without quitting.
- MagSafe LED: Auto (orange while charging, green when plugged in and not charging) or Off.
- Power flow: live watts from adapter to Mac and battery.
Terms are defined in CONTEXT.md.
Warning
Don't run EnerG and AlDente together. Both write the same SMC keys; EnerG warns when AlDente is running.
- Apple Silicon MacBook (Intel Macs are not supported)
- macOS 27 or later
curl -fsSL https://raw.githubusercontent.com/owittek/EnerG/main/scripts/get.sh | bashThe script checks your Mac, verifies the download's signature, installs to /Applications and opens EnerG.
Install by hand
EnerG isn't notarized (that needs a paid Apple Developer account), so Gatekeeper blocks a browser download. The command above downloads with curl, which Gatekeeper doesn't check.
-
Download
EnerG.zipfrom Releases and moveEnerG.appto Applications. -
Open it. macOS says it can't verify the app; click Done.
-
In System Settings → Privacy & Security, scroll down to Security and click Open Anyway next to “EnerG.app” was blocked.
Click Install Helper in the popover, then allow EnerG under System Settings → General → Login Items → Background App Activity.
Run the install command again. It replaces the app and restarts the helper (asks for your password).
A root helper, energd, does all hardware writes. It is registered with SMAppService, and the menu bar app talks to it over XPC; only apps signed by the same team can connect.
- Charge Limit uses the native macOS limit through the private PowerUI framework. When you lower the limit while plugged in, macOS runs the Mac from the battery until it is back at the limit (the Limit Drain), then holds it there on AC.
- Limits below 80%, which PowerUI rejects, are written to the smartcharging daemon's own defaults. When the battery is steady, a one-second cut of adapter power makes the daemon apply them. See ADR 0001.
SMC keys used:
| Key | Purpose |
|---|---|
CHIE |
Cut adapter power (applies limits below 80%) |
AC-W |
Whether a charger is physically plugged in |
B0AC × B0AV |
Live battery power (the battery registry refreshes only about once a minute) |
ACLC |
MagSafe LED |
EnerG relies on private frameworks and undocumented SMC keys, so a macOS update can break it.
- Click Uninstall Helper in the popover footer. It hands charging back to macOS, turns the native Charge Limit off (as Pause does) and unregisters
energd. - Quit EnerG and move
EnerG.appto the Trash.
Your settings stay in /Library/Application Support/EnerG/settings.json, so a reinstall restores them. Delete that file for a clean slate.
If the helper can't be reached, or you stop it another way
- Uninstall Anyway (offered in the notice when the helper can't be reached) removes the helper without handing charging back first. If the helper is still running, it turns the adapter back on and hands the LED back as it stops; if not, both may stay as last set. The native Charge Limit may stay at its last value.
- Switching EnerG off in System Settings → General → Login Items stops
energdthe same way: the adapter comes back on, the LED is handed back, and the native Charge Limit stays at its last value. - In both cases a limit below 80% may stay in effect. Turning the Charge Limit off in System Settings → Battery clears it.
The popover shows short notices; raw errors go to the system log (subsystem app.energ, categories app, hardware, energd):
log stream --predicate 'subsystem == "app.energ"' --level infobrew install xcodegen
scripts/install.sh # generates the Xcode project, builds Debug, installs to /ApplicationsFirst set DEVELOPMENT_TEAM in project.yml to your own Team ID; it ships with the author's (XG5GU82KF7), and signing fails with someone else's. Use the OU field of your Apple Development certificate (Xcode → Settings → Accounts), not the identifier in the certificate's name.
Policy tests, no hardware needed:
swift test --package-path Packages/EnerGKitThe smoke test exercises real hardware: it cuts the adapter, cycles the MagSafe LED and changes the Charge Limit, then restores the original state on exit. Before running it, quit AlDente (it would override the test's writes) and, if the EnerG helper is installed, suspend it (it turns the adapter back on mid-test):
swift build --package-path Packages/EnerGKit --product energ-smoke
sudo launchctl kill SIGSTOP system/app.energ.energd # only if the helper is installed
sudo scripts/smoke.sh # watch the MagSafe LED
sudo launchctl kill SIGCONT system/app.energ.energd # resume the helperBump MARKETING_VERSION in project.yml, commit and push, then run scripts/release.sh. It builds a signed EnerG.zip and publishes it as GitHub release v<MARKETING_VERSION>. Pass --no-publish to stop after the build.
