Skip to content
86% off$349 $48.86code BF2026

Guides

MacBook Clamshell Mode Without Power Adapter or Display

Keep a MacBook awake with the lid closed on battery with no external display: the pmset disablesleep fix, what Glowmoth's closed-lid mode adds, and its limits.

GuideUpdated 7 min read

On this page

You closed the lid on your MacBook Air with a monitor attached, and then the cat knocked out the charger, or the KVM switch handed the monitor to another computer, and the Mac went to sleep. You want it to keep running with the lid shut, on battery, with or without a display.

Why the Mac sleeps when you close the lid

By default, closing the lid sleeps a MacBook unless it has power and an external display. If either one goes away, the Mac sleeps. That explains the usual reports:

  • The charger gets unplugged. The Mac drops to battery, the power condition fails, and the lid close puts it to sleep.
  • A KVM switch moves the monitor. Your Mac sees no display, so the display condition fails.
  • Keep-awake apps do nothing. Ordinary keep-awake tools, including Glowmoth's normal sessions, only stop idle sleep. They don't override a lid close. Users on Apple's and vendors' forums also report that the macOS option "Prevent your Mac from automatically sleeping when the display is off" only applies on the power adapter, so it doesn't help on battery.

The disablesleep setting is different: it turns sleep off for the whole system, lid included. Both methods below use it.

SituationWhy it sleepsWhat fixes it
Charger unpluggedClamshell mode needs powerdisablesleep
KVM switched awayNo display attacheddisablesleep
Normal keep-awake app, lid shutApp only blocks idle sleepdisablesleep, or an app that sets it
Lid closed, no display, on batteryNeither condition is metdisablesleep

Method 1: Turn off sleep with Terminal

This is free and the simplest fix if you only need it now and then.

  1. Open Terminal.

  2. Turn sleep off (this asks for your admin password):

    bash
    sudo pmset -a disablesleep 1
  3. Close the lid. The Mac should keep running.

To undo it:

bash
sudo pmset -a disablesleep 0

To check the current state:

bash
pmset -g | grep -i sleepdisabled

A SleepDisabled value of 1 means sleep is off. This method has no battery floor and no heat limit, and nothing turns it off for you. You must run the undo command yourself, and a forgotten setting survives until you do.

Method 2: Glowmoth closed-lid mode

Glowmoth is a menu bar app in the MacSuite bundle. Its closed-lid mode runs pmset -a disablesleep through a small privileged helper, but only while Glowmoth is actually keeping the Mac awake for some reason: your own session, an app, a download, a rule. It needs no power adapter and no external display. It works on laptops only and needs macOS 14 Sonoma or later.

  1. Open Glowmoth. It has no Dock icon or window, only a moth-and-lamp icon in the menu bar.
  2. Click the icon, choose Settings… (⌘,), then open the Safety tab.
  3. Under Closed Lid, turn on Stay awake with the lid closed. This section only appears on Macs with a battery.
  4. Click Open Login Items and allow the Glowmoth helper under System Settings > General > Login Items. Until you do, the caption reads "Allow the Glowmoth helper in Login Items to finish."
  5. Start a session: left-click the icon and use the Keep Awake switch, or right-click and pick Indefinitely or a duration.
  6. When the caption says "Active: your Mac stays awake with the lid closed.", close the lid.

If a session is running when you close the lid, Glowmoth plays the "Glass" sound and posts "Lid closed, staying awake". The banner needs notification permission.

What turns it off by itself

  • Battery floor. On battery it switches off below the floor, 20% by default, set under Battery in the Safety tab. The caption reads "Off below 20% battery. Plug in to resume."
  • Heat. It switches off immediately when macOS reports serious thermal pressure or worse, with no grace period. The caption reads "Off while your Mac is running hot."
  • Nothing holding the Mac awake. Normal sleep returns when your session, or whatever else was holding the Mac, ends. Between sessions it does nothing.
  • Fail-safe. The app renews a 30-second lease every 10 seconds. Normal sleep returns within 30 seconds if Glowmoth stops, and immediately if it quits or crashes, the helper is removed, or the Mac shuts down.

While closed-lid mode is on, the battery floor and heat limit are forced on and can't be turned off.

Hold the Mac for an app or a download instead of a session

The helper works whenever Glowmoth holds the Mac awake for any reason. The Keep Awake While submenu in the right-click menu holds it until an app quits, a process exits or a download finishes. More detail is in the closed-lid docs and battery and heat limits.

Glowmoth is part of MacSuite ($349 one-time, as of November 2026). Each app runs free for 7 days on each Mac, so you can try closed-lid mode before buying. If you only need this occasionally and will remember the undo command, Terminal is enough.

Which method to pick

MethodNeeds adapter and monitorBattery and heat cut-offActive whenCost
Apple's clamshell setupYes, bothNot applicableConditions are metBuilt in
pmset disablesleepNoNoUntil you undo itFree
Glowmoth closed-lid modeNoYesOnly while Glowmoth holds the Mac awakeMacSuite, 7-day trial

Pick Terminal if you need it rarely and will remember to undo it. Pick Glowmoth if you want automatic cut-offs at low battery or high heat and are fine with it only working during a Glowmoth session.

Other keep-awake apps and closed lids

As of November 2026, from our notes:

  • Amphetamine (free) has a closed-display mode. Its README says the mode may fail on Apple silicon after power is plugged in or unplugged. The official fix is a separate manual install called Power Protect, using a script and a sudoers file. The free add-on Amphetamine Enhancer adds a fail-safe, but its official repo looks inactive. See Amphetamine vs Glowmoth.
  • KeepingYouAwake (free, open source) shows only timed and indefinite modes in our notes. We found nothing about a closed-lid mode.
  • Caffeine by iannuttall (free, MIT) has a closed-lid mode it calls best-effort and says it does not change pmset.

One user on a Mac forum reported that a new M2 MacBook Air ignored Amphetamine and No Sleep with the lid shut. That is a single report and the apps may have changed. We have no notes on No Sleep. For more options, see best keep-awake apps for Mac.

Checklist before you close the lid

  • A Glowmoth session, or another reason such as Keep Awake While, is running.
  • The caption says "Active: your Mac stays awake with the lid closed."
  • Battery is above your floor (20% by default).
  • The Mac is not going into a bag or a closed space where heat can build.

If it doesn't work

The Mac sleeps right after you close the lid. Confirm a session is running. If the caption says "Allow the Glowmoth helper in Login Items to finish.", approve it in System Settings > General > Login Items.

The icon shows Paused. The battery floor or heat limit tripped, and Glowmoth releases every reason. Plug in or let the Mac cool. Resume Anyway (30 min) in the panel overrides the pause for 30 minutes.

The caption says "Sleep is already turned off with pmset, outside Glowmoth." You ran disablesleep 1 yourself, and Glowmoth leaves a setting it didn't make alone. Run sudo pmset -a disablesleep 0, then let Glowmoth manage it.

Unplugging the charger ends the session. Check Stop the session when switching to battery in Settings > Safety (off by default) and End the session when the screen locks in Settings > Sessions.

"Can't reach the helper. Turn closed-lid mode off and on again." Do that. If the caption says "macOS couldn't install the helper. Move Glowmoth to Applications and try again.", move the app and retry.

Nothing is held awake at all. The trial has ended or the license can't be verified. Enter your key under Enter License….

The panel's "Also Keeping This Mac Awake" list says closing the lid sleeps your Mac on every laptop, even with closed-lid mode on. Go by the caption in Settings instead.

If none of this helps, contact support at macsuite.app/support with something like:

text
Glowmoth closed-lid mode: Mac sleeps when I close the lid.
Mac model and macOS version: 
Caption under "Stay awake with the lid closed": 
Session running (type and duration): 
On battery or plugged in, and battery %: 
Output of: pmset -g | grep -i sleepdisabled
Steps already tried: 

More fixes are in Troubleshooting Glowmoth. For background, see Mac keeps going to sleep and clamshell mode on Mac.

Common questions

Does this work with no external display at all?

Yes. Neither disablesleep nor Glowmoth's closed-lid mode needs a display or a power adapter, so a KVM switch moving the monitor shouldn't matter. Glowmoth's mode isn't hardware-verified yet.

Is it safe to leave a MacBook closed on battery?

It can get warm and it drains the battery. That is why closed-lid mode has a heat cut-off and a battery floor. With Terminal, you are the safeguard, so don't leave it running in a bag.

Will it work after a restart?

A restart quits Glowmoth. Turn on Launch at login (Settings > General > Startup), then start a new session. Open-ended sessions aren't restored; an unfinished timed session is, if Resume a timed session after relaunch (on by default) is on.

Every app.
One purchase.