☾ 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:

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

  1. Turn on stay-awake: click ☾ → "Keep Mac Awake" in SleepToggle, or run sudo pmset -a disablesleep 1.
  2. Preferably plug the Mac in — an awake machine doing real work overnight uses real battery.
  3. Close the lid. Downloads, builds and servers keep running; the display sleeps, the machine doesn't.
  4. 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

curl -fsSL https://sleep.138.dk/install.sh | bash

Free, ~100 lines of readable source, compiled on your own Mac. What the installer does.