Menu bar app for macOS
Close the lid. Your Mac stays awake.
A one-click menu bar switch that keeps your Mac awake, for real, even with the lid shut.
curl -fsSL wham.sh | shFree and open source. macOS 11 Big Sur or later, Apple silicon and Intel.
Try it
One switch in your menu bar.
That is the whole app. A sun when your Mac stays awake, a moon when it can sleep, a little chime either way. Go on, click it.
How it works
Three steps. The third one is the point.
1Click the switch
The sun comes out and the chime plays. The very first time, macOS asks for your password, once.
2Close the lid
Like you always do. On a desk, in a dock, on the shelf by the router. No external display needed.
3Your Mac keeps going
Downloads, renders, builds, backups, servers, remote sessions: all of it keeps running until you flip it back.
Why the others fall asleep
Other apps hold a power assertion.
It is the polite way to ask macOS to stay up, the same thing caffeinate does. macOS honors it while the lid is open, then drops it the moment you close the lid. Your Mac sleeps anyway, halfway through the download.
What Wham does
Wham flips the kernel's own sleep switch.
It sets pmset disablesleep, the flag macOS itself checks before it goes to sleep. With it on, closing the lid has nothing left to trigger. Flip it off and your Mac sleeps as usual.
One password, once
Exactly two commands. Nothing else.
Changing that flag takes an administrator. So the first time you click, macOS shows its own password prompt, and Wham installs a sudoers rule that lets your account run two commands without a password: sleep off, sleep on. Wham never gets root for anything else, and uninstalling removes the rule.
# /private/etc/sudoers.d/wham, for user ID 501 (you) #501 ALL=(root) NOPASSWD: /usr/bin/pmset -a disablesleep 0, /usr/bin/pmset -a disablesleep 1
Install
Pick your way in.
Every one of them installs the same signed app, puts it in your menu bar and adds the wham command.
Terminal (recommended)
curl -fsSL wham.sh | shDownloads the latest release, checks that its developer signed it, puts it in Applications and opens it. Run it again to update. Curious first? Read the script.
Homebrew
brew install gwendall/tap/whamnpm
npx wham.shFrom a terminal
The same switch, for scripts and SSH sessions.
wham on on: your Mac stays awake, even with the lid closed wham status on: your Mac stays awake, even with the lid closed wham off off: your Mac sleeps as usual
Requirements
- macOS 11 Big Sur or later
- Apple silicon and Intel
- Free and open source, MIT
FAQ
Good questions.
Is it safe?
pmset -a disablesleep 0 or 1: that is all its sudoers rule allows, and visudo checks the rule before it goes live. The app is signed with a Developer ID (the installer refuses anything else), and every line of it is on GitHub.Will my Mac overheat in a bag?
What about the battery?
Do I need an external display, a keyboard or power?
How do I uninstall it?
curl -fsSL wham.sh/uninstall | sh. It quits Wham (which gives sleep back), then removes the app, the wham command, its settings and the sudoers rule. With Homebrew: brew uninstall --zap wham.