Keeping Mac work alive without pretending awake means safe
A developer usually meets Mac power management through a simple need. A build, local server, download, or agent is still running, and idle sleep would interrupt it. The caffeinate command can be enough for that open lid case. Lid close is a different boundary. An idle sleep assertion does not mean the same thing as a closed display session, and a product should not blur the distinction. I built Afterlid around three explicit states. Sleepy follows normal sleep. Awake prevents idle system and display sleep while the lid is open. Always On is the lid closed mode, with the display off. The important engineering work begins after activation. What happens if the app crashes? What happens when the battery is falling or the machine is under thermal pressure? What state is restored after a helper failure? For Afterlid, Always On ends at 30 percent battery while unplugged, under serious or critical thermal pressure, when the app heartbeat disappears, or after eight hours. When a limit fires, the app drops its wake assertion and returns the Mac to normal sleep behaviour. The current implementation uses a small privileged helper and an undocumented macOS sleep setting for the lid closed path. That makes broad hardware testing and honest release notes essential. It is not something I want to hide behind a friendly menu bar character. A useful principle emerged from the work: activation is a feature, but recovery is the product. If you are building a system utility, test the path back to the operating system defaults with the same seriousness as the path into your special mode. Founder disclosure: I built Afterlid. The full product and current boundaries are here: AfterLid Top comments (0)
Comments
No comments yet. Start the discussion.