How to Keep Your Mac Awake with the Lid Closed

Your MacBook can run with the lid closed in clamshell mode, but it needs an external display, power, and an external keyboard or mouse. Shake It On works in clamshell mode because it generates mouse events on the external display, keeping the system awake.

What is clamshell mode?

Clamshell mode is when you close your MacBook's lid and keep using it through an external display. The built-in screen turns off, but the Mac stays awake and drives the external monitor. It's how a lot of people use their MacBook as a desktop.

Apple supports this officially, but they don't call it "clamshell mode" anywhere in System Settings. There's no toggle for it. It just works automatically when the right conditions are met. The problem is figuring out what those conditions actually are, because macOS is picky about it.

What you need for clamshell mode

macOS requires three things to stay awake with the lid closed:

  1. An external display connected. Plugged in and recognized by macOS. It needs to be on and active before you close the lid.
  2. Power connected. Your MacBook must be plugged into a charger. macOS won't run clamshell mode on battery because it would drain too fast with no way to see the battery level.
  3. An external input device. A keyboard, mouse, or trackpad connected via USB or Bluetooth. macOS needs to know you have a way to interact with the computer after the lid is closed.

If any one of these is missing, closing the lid puts your Mac to sleep like normal.

Note
On newer MacBooks with Apple Silicon, the order matters. Connect your external display and input devices first, make sure everything is recognized, then close the lid. Doing it in the wrong order can still trigger sleep.

Using Shake It On in clamshell mode

Even with clamshell mode working correctly, macOS still has an idle timer. If you stop using the keyboard and mouse for long enough, your Mac can go to sleep with the lid closed. This is especially annoying during long downloads, renders, or overnight tasks where you're not actively at the keyboard.

Shake It On prevents this by generating mouse movement on the external display. Since the mouse events happen on the active screen, macOS sees them as real user activity and keeps the system awake. It doesn't matter that the built-in display is off.

The conditions system is particularly useful here. You can set Shake It On to:

  • Run only when an external display is connected
  • Pause when you're actually using the Mac (it detects real input)
  • Run on a schedule for overnight tasks
  • Stop on weekends if your MacBook lives at your desk during the week

Set it up once and your clamshell Mac stays awake whenever you need it to, without you touching anything.

Shake It On keeps your clamshell Mac awake with mouse movement on your external display. $9.99 one-time. Get Shake It On for $9.99

Common clamshell mode problems

If clamshell mode isn't working for you, check these:

  • Mac sleeps immediately after closing the lid. Make sure the charger is plugged in and the external display is recognized before you close the lid. Check System Settings → Displays to confirm macOS sees the monitor.
  • External display goes black after a few minutes. This is the idle timer. macOS is putting the display to sleep because there's no activity. This is exactly what Shake It On prevents.
  • Bluetooth keyboard/mouse won't wake the Mac. Go to System Settings → Bluetooth, click the info button next to your device, and make sure "Allow this device to wake the computer" is enabled. Some cheaper Bluetooth devices don't support wake.
  • Mac wakes briefly then sleeps again. This usually means one of the three requirements isn't met. Double-check that power, display, and input device are all connected and recognized.
  • USB-C dock issues. Some docks don't pass through enough power or don't properly signal display connection to macOS. Try connecting the charger directly instead of through the dock.
  • macOS update broke it. Apple occasionally changes clamshell behavior between macOS versions. After a major update, you may need to reconnect your display and re-pair Bluetooth devices.
Tip
If you've confirmed everything is connected properly and your Mac still sleeps in clamshell mode, Shake It On can keep it awake by generating continuous mouse activity. It works around whatever quirk macOS is exhibiting.

Frequently Asked Questions

Can I use clamshell mode without an external display?
Not officially. macOS requires an external display to enter clamshell mode. Without one, closing the lid puts your Mac to sleep.
Does Shake It On work when the lid is closed?
Yes. Shake It On generates mouse events that macOS processes regardless of whether the built-in display is active. The cursor moves on your external display.
Keep your Mac awake the easy way.
Shake It On lives in your menu bar and uses organic mouse movement to prevent sleep. Set it once and forget it.
Get Shake It On for $9.99
One-time purchase. No subscription. Free updates forever.