Skip to content
Wham.sh

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 | sh

Free 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.

Sound on: that is the real chime, an 8-bit arpeggio played by your browser.

How it works

Three steps. The third one is the point.

  1. 1Click the switch

    The sun comes out and the chime plays. The very first time, macOS asks for your password, once.

  2. 2Close the lid

    Like you always do. On a desk, in a dock, on the shelf by the router. No external display needed.

  3. 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 | sh

Downloads 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/wham

npm

npx wham.sh
Download for MacWham.dmg: open it, drag Wham to Applications.

From 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
gwendall/wham on GitHub

FAQ

Good questions.

Is it safe?
The only thing Wham can do as root is run 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?
It can. With Wham on, your Mac stays fully awake with the lid shut, and a busy laptop in a closed bag has nowhere to put its heat. Wham is meant for desks, docks and shelves, where air can move. Before you pack up, flip it off and your Mac sleeps when you close it, like it always did.
What about the battery?
Wham itself costs next to nothing: it reads one kernel flag every two seconds. But an awake Mac drains its battery like an awake Mac, lid closed or not. For long jobs, plug it in.
Do I need an external display, a keyboard or power?
No. That is what macOS asks for its own “clamshell mode”, and Wham does not need any of it. Close the lid on a bare laptop and it stays awake.
How do I uninstall it?
One line: 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.
Why not the Mac App Store?
App Store apps live in a sandbox, and a sandboxed app cannot change the kernel's sleep setting. The ones that try settle for a power assertion, which is exactly what stops working when you close the lid.
What happens when I quit Wham?
Sleep comes back. Quitting turns the setting off on the way out, whether you quit from its menu (right-click the switch), from a script, or by logging out.