• 2 min read

Stamina

A menu bar app for Apple silicon Macs that sets a charge limit, shows what drains the battery, and learns how I charge.

SwiftSwiftUImacOSIOKitSMCWidgetKit

The Stamina website

What it is

Stamina is a native menu bar app for Apple silicon Macs on macOS 15 or later. It holds the battery at a charge limit, shows which apps are draining it, and builds a report of when the battery drains and how it gets charged. The app is 9 MB. Everything runs on the Mac, with no account and no usage data sent anywhere.

Insights: what is draining the battery, with a one-tap fix Energy use per app in percent per hour and watts Battery held at the 80% limit

The free version has the charge limit, live power, health, cycle count and temperature, top apps by energy, Low Power Mode automation and alerts. Pro adds insights with one-tap fixes, the Battery Report, time-left and health predictions, heat protection, calibration, scheduled top-ups, widgets and Shortcuts actions. Licenses are Ed25519-signed keys.

How it works

  • Reading. Battery data comes from AppleSmartBattery in IOKit and SMC reads. Energy per app comes from IOReport counters and per-process proc_pid_rusage, plus power assertions and display brightness.
  • Charge control. A small root helper, registered with SMAppService, writes the SMC keys. The policy that decides what to write is a pure function with a fixed order: unplugged, safety floor, calibration, heat, discharge, top-up, native limit, then the limit and resting range.
  • Staying light. It samples every second only while the popover is open and about once a minute otherwise, and it reacts to power-source notifications. At idle it uses roughly 25 MB of memory and about 0% CPU.

The repo also has a diagnostics CLI for the SMC, IOReport and the helper, and a tool that renders UI states to PNG without Xcode.

Stack

Swift 6, SwiftUI, IOKit, SMC, IOReport, XPC, SMAppService, WidgetKit, App Intents, Sparkle. The website is static and hosted on Vercel.

Back to top