☾ SleepToggle · overnight use
Keep downloads, builds and servers running on a closed MacBook
The short answer: by default, closing the lid forces sleep and everything stops — downloads pause, builds freeze, SSH sessions drop. To keep them running, either leave the lid open, or run sudo pmset -a disablesleep 1 (what SleepToggle toggles from the menu bar) and close the lid.
What actually stops when the lid closes
Lid-close is forced sleep: the CPU halts, the network interface goes down, and every process pauses mid-instruction. In practice that means:
- Downloads and uploads stall — most resume on wake, some (large transfers, flaky servers) start over.
- Builds, renders, ML training runs freeze until the lid opens.
- SSH and screen-sharing sessions into the Mac drop — the machine is unreachable while asleep.
- Local servers, Docker containers, backup jobs stop serving.
Keep-awake apps like Amphetamine or caffeinate don't change any of this: they prevent idle sleep, and forced sleep ignores them (why, in detail).
The overnight recipe
- Turn on stay-awake: click ☾ → "Keep Mac Awake" in SleepToggle, or run
sudo pmset -a disablesleep 1. - Preferably plug the Mac in — an awake machine doing real work overnight uses real battery.
- Close the lid. Downloads, builds and servers keep running; the display sleeps, the machine doesn't.
- In the morning, turn it back off (☕ → "Allow Sleep", or
sudo pmset -a disablesleep 0). The setting persists across reboots, so it won't undo itself.
Two warnings that matter
- Ventilation: a closed, working MacBook vents less. On a desk overnight it's fine; under a pillow or in a sleeve it isn't. Never in a bag.
- The forgotten switch: the single most common failure mode is leaving stay-awake on and bagging the laptop the next day, arriving to a hot, flat Mac. This is why SleepToggle keeps a state icon permanently in the menu bar instead of hiding the setting in Terminal.
curl -fsSL https://sleep.138.dk/install.sh | bash
Free, ~100 lines of readable source, compiled on your own Mac. What the installer does.