GitHub - iamdadzilla/Macsomnia: macOS menu-bar app that keeps your Mac awake with the lid closed, with a red indicator, auto-off timer, and a hardware-danger warning. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search/
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
iamdadzilla
Macsomnia
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>46 Commits<br>46 Commits
.github/workflows
.github/workflows
Sources
Sources
Tests/MacsomniaCoreTests
Tests/MacsomniaCoreTests
icon
icon
release
release
.gitignore
.gitignore
LICENSE
LICENSE
Macsomnia.icns
Macsomnia.icns
PROMOTION-PLAN.md
PROMOTION-PLAN.md
Package.swift
Package.swift
README.md
README.md
macsomnia_demo.gif
macsomnia_demo.gif
make-app.sh
make-app.sh
View all files
Repository files navigation
Macsomnia
A macOS menu-bar app that stops your Mac from sleeping — including clamshell<br>(lid closed) with no external display — to keep long-running light jobs (AI<br>agents, builds, downloads) alive.
When active, a red strip spans the top of every screen and the menu-bar label<br>shows a live countdown, so you can never miss that it's on. An auto-off timer<br>turns it off after a duration you pick.
Requires macOS 13 (Ventura) or later.
⚠️ Hardware warning
Disabling clamshell sleep defeats a thermal-protective behavior. Macsomnia is<br>intended for light workloads. Running heavy, sustained CPU/GPU load with the<br>lid closed and no external cooling can cause dangerous heat buildup and may<br>damage your hardware. Use the auto-off timer. Macsomnia is provided as-is, with<br>no warranty; you use it at your own risk.
Install
Homebrew (recommended)
brew tap iamdadzilla/macsomnia<br>brew install --cask macsomnia
Recent Homebrew asks you to trust a third-party cask tap the first time. If the<br>install stops with an "untrusted tap" message, run the command it suggests<br>(brew trust iamdadzilla/macsomnia) and re-run the install.
Upgrade later with brew upgrade --cask macsomnia.
Direct download
Grab the Macsomnia-.zip from the latest release,<br>unzip it, and move Macsomnia.app to /Applications. Builds are signed and<br>notarized, so they open without Gatekeeper warnings.
Build from source
git clone https://github.com/iamdadzilla/Macsomnia.git<br>cd Macsomnia<br>./make-app.sh # builds Macsomnia.app
Then move Macsomnia.app to /Applications. (Requires the Xcode command-line<br>tools.)
First run
Open Macsomnia. It shows a one-time danger/liability warning you must accept.<br>A zzz icon then appears in the menu bar.
The first time you enable it, Macsomnia registers a small privileged helper<br>(an SMAppService background daemon) that runs pmset as root. macOS asks<br>you to allow Macsomnia's background item in System Settings → General →<br>Login Items & Extensions (under "Allow in the Background"). Approve it, then<br>enable again — after that it works with no further prompts.
Use
Click the icon → choose a duration: 30 min · 2 h · 4 h · 8 h · until I turn<br>it off .
While ON: a red strip appears across the top of every display, the label shows<br>a live countdown, and the auto-off timer will disable it.
Disable now turns it off. Quitting the app also restores normal sleep.
If sleep gets disabled by anything else, Macsomnia detects it within ~5s,<br>shows the red strip, and notifies you.
How it works
A signed helper daemon runs these as root, reached over XPC — only Macsomnia's<br>own signed app is allowed to talk to it:
Enable: pmset -b sleep 0 ; pmset -b disablesleep 1
Disable: pmset -b sleep 5 ; pmset -b disablesleep 0
disablesleep 1 is what keeps the Mac awake with the lid closed — stronger than<br>the idle-sleep prevention that caffeinate and similar tools use.
Uninstall
brew uninstall --cask macsomnia # or delete Macsomnia.app
Upgrading from 1.0 (which used a sudoers rule instead of the helper)? Remove the<br>now-unused rule:
sudo rm -f /etc/sudoers.d/macsomnia
License
MIT — see LICENSE.
See also
Promotion plan — launch and outreach notes
About<br>macOS menu-bar app that keeps your Mac awake with the lid closed, with a red indicator, auto-off timer, and a hardware-danger warning.<br>Resources<br>Readme<br>MIT license<br>Activity<br>Stars<br>0 stars<br>Watchers<br>0 watching<br>Forks<br>0 forks<br>Report repository
Releases
Packages
Contributors
Languages
You can’t perform that action at this time.