Keep Your Mac Awake: Disable Sleep On Lid Close

don

MacBooks are designed to enter a sleep state when the lid is closed, which is usually not a problem for users. However, some people may want to prevent this from happening, especially when using an external monitor. While Apple has introduced a clamshell mode in newer MacBooks that automatically activates when an external display is connected, older MacBooks require specific steps to stay awake when the lid is closed. This can be achieved through system settings, terminal commands, or third-party apps, each offering varying levels of convenience and compatibility.

shunsleep

Using an app like Amphetamine or Caffeinated

Amphetamine is a free app available on the Mac App Store that can keep your Mac awake by overriding the Energy Saver settings. It has a simple on/off switch, or you can set it to automatically activate through configurable triggers. For example, you can set Amphetamine to activate when a specific app is running, when your Mac's battery is charging, or when your Mac is connected to a specific Wi-Fi network. It also has advanced features, such as the ability to lock your Mac's screen after a period of inactivity, move the mouse cursor periodically, and keep your MacBook awake while its lid is closed.

Caffeinated is another app available on the Mac App Store for 99p. It also overrides the Energy Saver settings to keep your Mac awake, preventing your Mac from going to sleep, dimming your screen, or starting the screensaver. It has a minimal and easy-to-use interface, and you can activate it with a single click on the coffee cup in your menu bar. It is optimized for macOS Big Sur and Apple Silicon and is also compatible with older macOS systems.

shunsleep

Connecting an external monitor

If you want to connect an external monitor to your MacBook, you will need to follow a few steps. Firstly, ensure that your MacBook is plugged into a power source using the power adapter. Then, connect an external keyboard and mouse to your MacBook. These can be wireless or Bluetooth devices.

Next, connect your MacBook to the external monitor using the appropriate adapter, and turn on the monitor. Once your MacBook's desktop appears on the external display, you can close your MacBook's lid. Your external monitor may flash off briefly, but it should then display your desktop. You can wake your MacBook by pressing a key on the keyboard or moving the mouse.

Note that your MacBook will need to be plugged into a power source for this to work. Additionally, you may need to adjust your energy-saving settings to prevent your MacBook from automatically sleeping when the display is off. You can do this by going to System Settings or System Preferences > Lock Screen and selecting "Never" for "Turn display off on power adapter when inactive."

If you don't see that option, go to Battery > Power Adapter and select "Never" for when the display is off. You can also download third-party apps, such as Amphetamine or Caffeinated, to keep your MacBook awake.

shunsleep

Changing lock screen and battery settings

To prevent your MacBook from sleeping when the lid is closed, you will need to change some lock screen and battery settings. This will make your MacBook behave like a desktop Mac when you close the lid.

Firstly, click on System Settings or System Preferences from the Apple menu in the upper left corner. Then, click on Lock Screen and select the menu next to "Turn display off on power adapter when inactive". Choose "Never".

If you don't see that option, go to Battery > Power Adapter instead, and select "Never" from the slider. Next, click on Battery from the menu, then choose Options. Here, you will need to switch on the toggle next to "Prevent automatic sleeping on power adapter when the display is off". This option may be called "Prevent computer from sleeping automatically when the display is off" in some versions of macOS.

Additionally, you can install third-party apps such as Amphetamine or Caffeinated to keep your MacBook awake with the lid closed without connecting a monitor.

shunsleep

Using Terminal to enter commands

If you want to prevent your MacBook from sleeping when the lid is closed, you can use the Terminal to enter commands and make changes to your sleep settings. Here's a step-by-step guide:

Step 1: Open Terminal

To begin, you need to open the Terminal application on your MacBook. You can find it by opening Launchpad and searching for "Terminal", or by using the Spotlight search (press Command + Spacebar and start typing "Terminal").

Step 2: Enter the Command to Disable Sleep

Once Terminal is open, you can use the following command to disable sleep when the lid is closed:

Sudo pmset -a disablesleep 1

After entering this command, you will be prompted to enter your password or passcode. This command will prevent your MacBook from automatically going to sleep when the lid is closed.

Step 3: Re-enable Sleep (Optional)

If you want to re-enable sleep mode at a later time, you can use the following command:

Sudo pmset -a disablesleep 0

Again, you will be prompted to enter your password or passcode. This command will restore the default behaviour of your MacBook, causing it to go to sleep when the lid is closed.

Additional Notes:

  • It is important to remember that disabling sleep when the lid is closed can cause your MacBook to heat up, especially if it is in an enclosed space like a bag. Always re-enable sleep or manually put your MacBook to sleep before placing it in an enclosed space.
  • The above commands are for macOS Ventura, Sonoma, and later versions. For older versions of macOS, the commands are slightly different:
  • To disable sleep: `sudo pmset -b sleep 0; sudo pmset -b disablesleep 1`
  • To re-enable sleep: `sudo pmset -b sleep 5; sudo pmset -b disablesleep 0`
  • If you prefer a graphical user interface, you can use third-party apps like Amphetamine (available on the Mac App Store) or Caffeinated (available on the Mac App Store for 99p) to keep your MacBook awake.

shunsleep

Using a wireless or wired mouse

To use a wired or wireless mouse with your MacBook when the lid is closed, you will need to connect it to an external monitor, as well as a keyboard. This is because, even if you prevent your MacBook from sleeping when the lid is closed, the display on the MacBook itself will turn off.

To connect a wired mouse, simply plug it into one of your external monitor's USB ports. For a wireless mouse, make sure that Bluetooth is on and that the mouse is paired with the Mac.

If you want to prevent your MacBook from sleeping when the lid is closed, you can do so by changing your lock screen and battery settings. Here's how:

For macOS Ventura, Sonoma, and later:

Enter the following command:

Sudo pmset -a disablesleep 1

For macOS Monterey and older:

  • Open System Preferences.
  • Go to Battery (or Energy Saver).
  • Select 'Prevent your Mac from automatically sleeping when the display is off'.

Alternatively, you can use a third-party app, such as Amphetamine or Caffeinated, to keep your Mac awake.

Frequently asked questions

Your MacBook might not be sleeping when you close the lid due to incorrect sleep mode settings, interfering external peripherals, or background applications using resources.

Go to System Settings/Preferences > Battery > Options. Turn on "Prevent automatic sleeping on power adapter when the display is off".

Go to System Settings/Preferences > Lock Screen and select "Never" for "Turn display off on battery when inactive".

You can use third-party apps such as Amphetamine, Caffeinated, InsomniaX, or Sleep Control Centre. Alternatively, you can use Terminal to enter the command "sudo pmset -a disablesleep 1".

Try reconfiguring your sleep settings, disabling interfering background apps, checking your network access settings, and disconnecting external devices. If these don't work, try updating your system software or contact Apple Support.

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment