Keep your Mac awake while AI agents run. A minimal macOS menu bar app — left-click the pill icon to toggle, right-click to configure.
Or directly from GitHub Releases. Open the DMG and drag Modafinil to Applications. Apple-notarized — no security warnings.
| Left-click toggle | The pill icon breaks apart when active |
| Auto-stop timer | 30 min / 1 hour / 2 hours / 4 hours / Unlimited (localized: Japanese only when system language is Japanese) |
| Launch at login | Configure from the right-click menu |
| Lid-closed mode | Optional privileged helper keeps a standalone MacBook awake with the lid shut (clamshell), via pmset disablesleep |
| No Dock icon | Lives only in the menu bar |
- Reliable lid-closed (clamshell) mode via an optional privileged helper. Enable it once from the right-click menu (a one-time approval in System Settings → Login Items). A root
LaunchDaemonthen togglespmset disablesleep— the only mechanism that actually keeps a standalone MacBook awake with the lid shut. Replaces the previous best-effortcaffeinateapproach. - The helper auto-reverts
disablesleepwhenever sleep prevention stops, or if Modafinil quits or crashes, so a lidded Mac never gets stuck awake.
- Fixed Japanese localization detection: now properly falls back to Japanese strings only when the system language is set to Japanese (using
Locale.preferredLanguagesfor reliable detection even in accessory apps without.lprojresources). - Bumped to 1.2.0 with the above fix.
- Added 30-minute option to the timer
- Added English localization (Japanese strings are shown only when the system language is set to Japanese)
- Simplified menu back to the original minimal design
- Better support for keeping the Mac awake with the lid closed on a standalone MacBook (no external display), including preventing automatic screen lock
- macOS 14.0 Sonoma or later
- Apple Silicon or Intel
# Local unsigned build
./build.sh
# Signed + notarized DMG (requires Developer ID certificate)
PROD=1 ./build.shWhile active, Modafinil holds three IOPM assertions:
PreventSystemSleepPreventUserIdleSystemSleepPreventUserIdleDisplaySleep(blocks the display-sleep timer that triggers auto-lock)
These keep the Mac awake while the lid is open, and are released on deactivate. They do not override clamshell sleep — for the lid-closed case, see below.
Closing the lid on a MacBook with no external display always sleeps it. IOPM assertions and caffeinate cannot override this — the only thing that does is the system-wide SleepDisabled flag (pmset -a disablesleep 1), which requires root.
Modafinil ships an optional privileged helper (a root LaunchDaemon) to toggle that flag:
- Right-click the menu bar icon → Keep awake with lid closed…
- Approve the background item once in System Settings → General → Login Items. macOS requires this — it cannot be enabled programmatically — but the approval persists across reboots.
- With lid-closed mode on, activating sleep prevention also sets
disablesleep. Close the lid and the Mac stays awake.
The helper automatically clears disablesleep when prevention stops, or if Modafinil quits or crashes — so a lidded Mac never gets stuck awake.
- Security: preventing sleep this way also prevents the lock screen — opening the lid resumes your session without a password prompt. Use only on machines you trust (your personal dev laptop, not a shared or travel machine).
- The Mac can run warm with the lid closed. Keep it on a hard surface with good airflow; never inside a bag.
- AC power is recommended for long runs; on battery the OS fights harder to sleep.
Made by Gigaptera · Kobe, Japan
