Why Macs sleep in the first place
macOS is designed to put your Mac to sleep when you're not using it. It saves energy, extends battery life on laptops, and reduces wear on the display and other components. There's an idle timer that tracks mouse movement and keyboard input. Once enough time passes with no activity, the display dims, then the system sleeps.
This is fine most of the time. The problem is macOS doesn't know the difference between "I went to lunch" and "I'm waiting for a 4-hour render to finish."
The usual suspects
If your Mac keeps going to sleep when you don't want it to, check these first:
- Energy Saver / Battery settings — Open System Settings → Energy Saver (desktop) or Battery → Options (laptop). The "Turn display off after" slider controls how long your Mac waits before dimming. If it's set to a few minutes, that's your culprit.
- Lock Screen settings — System Settings → Lock Screen controls how quickly your Mac requires a password after sleep. This is separate from when it sleeps.
- Hot Corners — If you've set a hot corner to "Put Display to Sleep," you might be triggering it by accident when you move the cursor to that corner.
- Power Nap — This lets your Mac do background tasks during sleep (email, iCloud sync). It doesn't prevent sleep, it just makes sleep more useful.
- Scheduled sleep — Check if a scheduled sleep time is set in Energy Saver. This can force sleep even if you're actively using the Mac.
Quick fixes and why they're limited
You can set the display timeout to "Never" in Energy Saver. That stops your Mac from sleeping on its own. But it's a global change. Your Mac won't sleep until you manually put it to sleep or close the lid. If you're on a laptop, that means draining your battery if you walk away and forget.
And if you're on a corporate machine, your IT department may have locked these settings entirely. There's no scheduling, no conditions, and no indicator beyond an open Terminal window.
The conditional approach
The real fix is a tool that keeps your Mac awake only when specific conditions are met. Shake It On does exactly this. It moves your mouse slightly at regular intervals, resetting the idle timer, but only when your conditions say to.
Some examples of what you can set up:
- Stay awake only during work hours (weekdays, 9 AM to 6 PM)
- Stay awake when plugged in, sleep on battery
- Stay awake when a specific app is running (Xcode, Handbrake, etc.)
- Pause during video calls (camera detection)
- Pause when Focus/DND is on
You set it up once and don't think about it again. Your Mac stays awake when you need it to and sleeps when you don't.
Other things that cause unexpected sleep
- Low battery override — macOS will force sleep when battery drops below ~5%, regardless of your settings
- MDM/corporate policies — Your IT department may have locked Energy Saver settings via a management profile. You can check in System Settings → Privacy & Security → Profiles.
- Clamshell behavior — Closing the lid puts your Mac to sleep unless you have an external display, power, and an external keyboard or mouse connected
- Thermal throttling — In rare cases, extreme heat can trigger an emergency sleep to protect components