A small macOS menu bar app called Insomnia, published on GitHub under the account krishhgg, lets MacBook users keep their Mac awake for a set period, including while the lid is closed. The project page describes the tool as experimental and warns that its recovery system can fail, so it is best suited to people who run long, unattended jobs and want a clear end time.
What Insomnia does
Insomnia has no Dock icon and no main window. Its only interface is an eye icon in the menu bar. Users choose how long the Mac should stay awake, decide what happens when the lid closes, and can see when a change could not be undone. The project's central idea is that every awake session should have a defined end point.
To start a session, a user clicks the eye, enters days, hours and minutes, and presses Enter. During a session, clicking the eye or the countdown adds time, and pressing and holding the end control next to the countdown stops the session early.
The app also includes power safeguards. On battery power, Low Power Mode turns on below 40 percent and the session ends below 10 percent. Both thresholds are defaults that can be changed in Settings, and setting the end floor to 0 disables the battery-based ending. Heat rules are on by default. They switch on Low Power Mode when the Mac becomes seriously hot and end the session at critical heat. All of these rules work only while the app is running.
What happens when the lid closes
While a session is active, closing the lid triggers several actions, and opening it tries to reverse them. The timer keeps counting down while the lid is shut. According to the GitHub page, the steps are:
- The display and keyboard lights turn off, after Insomnia saves their brightness.
- Apps on a freeze list are paused until the lid opens. The list starts with Slack, WhatsApp and Discord.
- Audio is muted, and opening the lid unmutes each output Insomnia muted, even if the user has switched to a different output.
- Low Power Mode turns on, and it turns off when the lid opens unless a battery or heat rule still requires it.
- Docker Desktop can be frozen when no container is running, although this option is off by default.
A freeze-every-other-app option exists but is off by default. Even when enabled, it skips meeting, recording and dictation tools such as Zoom, Teams, FaceTime and OBS.
The page also notes a hardware limitation. On Mac laptops with Apple silicon or a T2 chip, closing the lid disconnects the built-in microphone, so anyone recording a meeting with the lid closed needs AirPods or an external microphone. Opening the lid does not end the session.
How recovery works
Insomnia writes each change to a recovery journal on disk before making it. Ending a session attempts to undo everything the journal lists. If the app crashes or quits, a separate recovery agent, a launchd job that runs every minute, attempts the same cleanup once the session's end time has passed.
The GitHub page is clear about the limits. The recovery agent cannot restore audio, so the user must reopen Insomnia for that. It does not monitor battery level or temperature. It also only unfreezes processes that Insomnia can prove it froze. Any process it cannot verify stays frozen until the user checks it. If the menu shows a recovery warning, the project advises dealing with it before leaving the Mac unattended.
Requirements, installation and security trade-offs
Insomnia requires macOS 26 or later on an Apple Silicon Mac. Users can install the latest stable release or a nightly prerelease, which contains the newest code but may be unstable. Building from source requires Xcode with Swift 6.2 or later.
The installer asks for an administrator password because it adds a sudoers rule at /etc/sudoers.d/insomnia. That rule lets the user's account run four specific commands without a password. The page points out that any program running under the same account could also use the rule, so readers should review it before installing. The installer also places the app in ~/Applications and sets up the recovery agent.
Settings and logs are stored in the user's Library folders with owner-only permissions. The page warns that logs can contain Wi-Fi network names, process details and terminal targets, so they should be checked before being shared.
Some optional extras need extra setup. For example, Insomnia can join an iPhone hotspot when Wi-Fi drops, and it can type into terminal panes that the user has marked, but it does not press Enter unless that setting is enabled.
Insomnia is a narrow tool with a clear purpose and an unusually detailed list of its own limits. Its appeal is clearest for people who need a laptop to stay awake through a long task with the lid closed. Because the project calls itself experimental, the sensible first step is a short, supervised test session, followed by a review of the log file, as the project recommends.
Related: Atticus Mac Voice Assistant Runs on Your Claude Plan, No API Key · Yowl: Free Open-Source Alarm Makes MacBook Theft Loud
Comments (0)