Insomnia is a modern macOS menu bar app that prevents your Mac from falling asleep, keeping your system or display active when you need it most.
Recently rewritten in SwiftUI using the modern MenuBarExtra API.
- Prevent Sleep: Keep your system awake indefinitely.
- Timed Wake: Set a timer — 15 min, 30 min, 1h, 2h, 4h, 8h, 12h, or 24h.
- Display Sleep: Allow the display to sleep while keeping the system running (useful for downloads or background audio).
- Battery Safety: Automatically deactivates when battery drops below 20%.
- Launch at Login: Automatically start Insomnia when you log in.
- Shortcuts & Siri: Trigger or configure Insomnia via Apple Shortcuts or Siri.
- Auto-Update Checker: In-menu banner when a new release is available.
- Modern Design: Native macOS menu bar experience with custom icons.
Check the Releases page for the latest .dmg installer.
- Clone the repository.
- Run the install script:
./install_app.sh
- Move
Insomnia.appto your Applications folder.
Note
If you see a message that the app is "damaged" or "cannot be opened", run this command in Terminal to fix the quarantine attribute:
xattr -cr /Applications/Insomnia.appYou can also build using Swift Package Manager:
swift build -c releaseThis project uses Swift Package Manager with two targets:
InsomniaCore— library containing all business logic (SleepManager.swift). Import this in tests.Insomnia— executable with the SwiftUI app (InsomniaApp.swift), Shortcuts intents (Intents.swift), and update checker (UpdateChecker.swift).
Open Package.swift in Xcode to start editing, or use the CLI:
swift build # debug build
swift test # run all tests
./install_app.sh # build release .app bundle
./create_dmg.sh # package into a DMG installer- Iconography by Seerat Rana