krishhgg / Insomnia
git clone https://github.com/krishhgg/Insomnia.git
v0.1.0 · 12d ago
A macOS menu bar app that safely keeps your MacBook awake with the lid closed, for timed agent sessions.
+7
stars, 24h · #1,910
+~49
stars, 7 days · #2,440
+~210
stars, 30 days · #2,429
1.7k
★ total · +3% this week
119
forks · 59 open issues
Star history (as recorded here)
LanguageSwift
LicenseMIT
Created2026-09-14 (1mo ago)
Last push3d ago
Watchers1
OwnerUser
GitHub topics
ai-agentsamphetamine-alternativecaffeinateclamshell-modeclaude-codecodexkeep-awakemacosmacos-appmenu-bar-appprevent-sleepswiftswiftui
Links
- GitHub: github.com/krishhgg/Insomnia
- Homepage: https://getinsomnia.app
- Releases · Issues · Hacker News mentions
README excerpt
Insomnia Keep your Mac awake. Give the session an end time. A macOS menu bar app for timed awake sessions. Insomnia is an eye icon that lives in your MacBook menu bar. It has no Dock icon and no main window. Set how long your Mac stays awake, choose what happens when the lid closes, and see when something could not be undone. Website · Install · Using it · Lid close · Recovery · Security > **Use a stable, well-ventilated surface, not a closed bag.** Insomnia is > experimental. Recovery can fail, and a running timer is not a safety > guarantee. > Validation status · Apple's ventilation guidance ## Install Requires macOS 26 or later on an Apple Silicon Mac. Paste this into your coding agent: [code] For the newest nightly, write "the newest Insomnia nightly prerelease" in place of "the latest stable Insomnia release". Nightlies are built from `main` on each day it has new commits. They have the newest code and may be broken. To install a release yourself, follow docs/install.md. It covers both channels, how to check the download, and `v0.1.0`, which installs differently. Settings > App shows the installed version, and "Check for updates" there tells you whether a newer release exists without installing anything. ### Build from source Needs Xcode with Swift 6.2 or later. Replace `v ` with the latest stable tag, or a nightly tag for the newest code: [code] What the installer changes on your Mac The installer needs your password, because the sudoers rule is a system file. It installs: - The app, at `~/Applications/Insomnia.app`. - A **recovery agent**, a `launchd` job that runs every minute. If the app is gone when a session should have ended, the agent tries to undo the session's changes. - A **sudoers rule** at `/etc/sudoers.d/insomnia`. A sudoers rule decides who can run what with `sudo`. This one lets your user account, not just Insomnia, run these four commands without a password: [code] Any program running as you can use that rule too, so review it before you install. docs/install.md lists every file and explains how upgrades replace them. ## Using it 1. **Start.** Click the eye in the menu bar, enter days, hours and minutes, and press Enter. 2. **Add time.** Click the eye or the countdown during a session. 3. **End early.** Press and hold the end control next to the countdown. 4. **Settings and status.** Right-click the eye. Quit asks Insomnia to undo the session first, and it refuses while a change is still waiting to be undone. Saved audio for an output that isn't connected doesn't hold it up. Insomnia restores that output if it reconnects while the app runs, or at the next launch. You don't have to close the lid, and opening it doesn't end the session. On battery power, Insomnia turns on Low Power Mode below 40% and ends the session below 10%. Those are the defaults. You can change both in Settings, and an end floor of 0 turns the battery end off. The heat rules turn on Low Power Mode when the Mac gets seriously