skip to content

Keep your Mac awake, lid closed included

Every keep-awake tool for the Mac gives up at the same moment: the one you close the lid.

caffeinate, KeepingYouAwake, Lungo and the rest hold power assertions, and an assertion dies with the process holding it the instant the lid shuts. Apple's own clamshell mode wants AC power, an external display and a keyboard attached. Nothing covers the ordinary case of a laptop on battery, lid down, still working.

awake covers it. It holds the one kernel flag that survives a closed lid, and it guards that flag with a resident daemon, because a flag that outlives its owner is how a laptop cooks itself in a bag.

  • A battery floor, 15% by default, that ends the session and lets the Mac sleep even when you insisted.
  • awake -w <pid> stays awake exactly as long as a process lives, matched on start time so a recycled pid cannot fool it.
  • Everything resets on reboot, by design.
  • If you flip the flag by hand, awake adopts it instead of silently undoing you.

A cup in the menu bar, a CLI that speaks the same state, and one authorization prompt for a rule covering exactly two commands.

brew install --cask adriangalilea/tap/awake
awake grant

Open source, MIT.

01

features

Nothing documented yet.

02

feature requests

vote on what's next, or propose it

proposed

planned

building

03

changelog

0.1.2

polish

  • awake has an icon, a steaming cup, so it shows up properly in Finder, in the Dock while it launches, and on the disk image instead of as a blank sheet of paper.

0.1.1

added

  • awake notify <path> points the out-of-band alert at any executable you like, called with the message as its only argument. The battery floor and Low Power Mode both end sessions while the lid is shut, where a screen notification reaches nobody. Nothing is shipped for it and nothing is assumed: a push service, an SMS gateway, a script that curls a webhook. awake notify alone shows it, --clear removes it. The call is made before the kernel flag drops, so the request leaves while the network is still up.

changed

  • The shell prompt recipe is in the README: six lines of starship over awake status --json, which omits the session key entirely when nothing is running.

0.1.0

added

  • Keeps the Mac awake with the lid closed, on battery, with no external display. Every assertion-based tool gives up at exactly that point, and Apple's clamshell mode wants AC power and a monitor attached.
  • A cup in the menu bar. Right-click toggles at your last duration, left-click opens the menu, and ⌃⌥⌘A does the same from anywhere. Remap it with awake hotkey.
  • A CLI that speaks the same state: awake 2h, awake --until 23:30, asleep to stop, and awake status --json for scripts.
  • awake -w <pid> stays awake exactly as long as a process lives, matched on start time so a recycled pid can never keep a dead job's session alive.
  • A battery floor, 15% by default, that ends the session and lets the Mac sleep even if you insisted. Low Power Mode does the same unless you forced it.
  • Sessions survive a crash and a reinstall, and never survive a reboot. The kernel flag resets at boot by design, and that safety is not worked around.
  • One authorization prompt, once, for a sudoers rule covering exactly two commands. awake grant --remove takes it back.