Same job as Awake.
A narrower key to the power settings.
Awake, an open-source app Ilias Ism launched in November 2026, is built for one thing: closing your MacBook lid while Claude Code, Codex, or Cursor keeps working. It's a good app with sharp ideas. Midnight Oil does the same job, runs as a full app on more Macs, and turns sleep off through a signed helper that only answers Midnight Oil.
The short version
On Apple Silicon with macOS 26 and happy with a sudoers rule? Awake is a solid, MIT-licensed choice. Want the menu bar app on an Intel Mac or an older macOS, or triggers, schedules, and sleep restored even if the app is killed? Midnight Oil.
What Awake gets right
It starts from the right problem. Bare caffeinate only blocks idle sleep, so closing the lid still triggers clamshell sleep, drops Wi-Fi, and kills a running agent. Raw sudo pmset -a disablesleep 1 fixes that but leaves the screen unlocked and can cook a MacBook in a backpack. Awake bundles the fix and the safeguards: it locks the screen the instant the lid closes, pauses at 10% battery or 40 °C, and resumes when the Mac recovers. It has a Control Center toggle, a menu bar timer, a short CLI (awake 45m, awake -- codex …), a Nix flake, and no telemetry. It's a thoughtful first release.
Where it stops
A passwordless sudo rule
Setup writes /etc/sudoers.d/awake, letting every member of the admin group run pmset -a disablesleep 0 or 1 without a password. The rule is narrow, two exact commands and validated with visudo, but it applies to every process running as any admin user, not just Awake. Midnight Oil's helper accepts connections only from the Midnight Oil app signed by its developer team.
A shell watcher holds the off switch
pmset disablesleep is a system setting that outlives the process that set it. Awake turns sleep back on from a background shell process that watches its caffeinate. That works when the timer or command ends, but if the watcher itself is killed, say by a logout or a stray kill, it exits without restoring sleep, and the Mac stays sleepless until you run asleep. Midnight Oil's helper is a launchd service: it turns sleep back on when the app quits or crashes, and again on its own launch if it was ever stopped.
The app is Apple Silicon and Tahoe only
Its Homebrew cask depends on arch: :arm64 and macos: :tahoe, and the only download is an arm64 DMG. On an Intel Mac or anything older than macOS 26 you can still install the command line tool from its Homebrew formula or Nix flake, but not the menu bar app or the Control Center toggle.
One kind of session
Indefinite, a timer, or while a command runs. No “until 7 AM,” no “while this app is open,” no schedules, and no triggers for Wi-Fi, power, displays, or devices.
Midnight Oil vs Awake
| Midnight Oil | Awake | |
|---|---|---|
| Price | Free | Free |
| Source code public | Yes (FSL, MIT after 2 years) | Yes, MIT |
| Closed-lid mode | Yes, opt-in | Yes |
| How it disables sleep | Signed helper, only answers Midnight Oil | sudoers rule for all admin users |
| Sleep restored if the app is killed | Yes, by a launchd helper | Only if its shell watcher survives |
| Locks the screen when the lid closes | Yes, unless docked to a display | Yes |
| Pauses when the Mac gets hot | Yes, lets it sleep; resumes once it wakes cool | Yes, resumes when cool (not for awake --) |
| Low-battery cutoff | Yes, level you choose | Yes, 10% by default |
| Control Center toggle | Yes (macOS 26) | Yes (macOS 26) |
| Command line | midnightoil run, start, 45m, status | awake, awake 45m, awake -- |
| Keep awake until a time | Yes | No |
| While an app is running | Yes | No |
| Triggers and weekly schedules | Yes | No |
| Battery temperature in the menu | No | Yes |
| Intel Macs | Yes | Command line only |
| Minimum macOS | 14 Sonoma | 26 Tahoe for the app |
| Install | Homebrew cask or DMG | Script, Homebrew, DMG, or Nix |
What Awake does better
It's MIT today, it shows the battery temperature in its menu, it ships a Nix flake and nix-darwin module, and it can run your own script when the lid closes, handy for unmounting an encrypted volume. If you're on Apple Silicon with Tahoe and want the smallest thing that works, it's a fine pick.
What Midnight Oil does better
A signed helper instead of a sudoers rule, sleep restored even if the app is killed, the full app on Intel and macOS 14, sessions that end at a clock time or when an app quits, ten trigger types, weekly schedules, and midnightoil run that returns your command's exit status and shares one session across parallel runs.
Switching
- Restore sleep and remove Awake's sudo rule. Run
asleep, then Awake's uninstall steps; check that/etc/sudoers.d/awakeis gone andpmset -gno longer showsSleepDisabled 1. - Install Midnight Oil.
brew install --cask coreyhaines31/tap/midnightoil - Set up closed-lid mode. Settings › Closed Lid › Install, then approve Midnight Oil once in System Settings › Login Items. Screen lock and the heat pause are on by default.
- Swap your commands.
awake 45mbecomesmidnightoil 45m --lid-closed;awake -- codex exec …becomesmidnightoil run --lid-closed -- codex exec ….
Other ways people keep a Mac awake
Close the lid. Keep the safeguards.
Free. No account, no subscription.
macOS 14 or later · Apple Silicon and Intel · brew install --cask coreyhaines31/tap/midnightoil