Member-only story

Close Lid and Keep Macbook Awake — without installing anything

A simple way to keep your MacBook awake when closing the lid.

Andrew Zhu
2 min readJan 7, 2022

Almost all articles from google will ask you to connect your Mac to an external monitor or install third-party software to keep MacBook awake after closing the lid. But connecting to an external monitor is not ideal, installing software is not always safe especially since the tool will usually ask for admin permissions.

Actually, there is no need to install anything at all. All you need is some commands in the terminal.

Disable and Enable Sleep

Open Terminal, use this command to disable MacBook sleep.

sudo pmset disablesleep 1

To test it, you can play a youtube video and close the lid. the video should still be playing, to revert back the lid-closing behavior, use the same command and change 1 to 0 like this.

sudo pmset disablesleep 0

Turn off the screen

If you are using an old MacBook, the display will turn off automatically when you close the lid, but you are using a newer MacBook like the M1 Macbook Air I am using, closing-lid will not turn off the screen.

Here is the way to walk around it:

System Preference -> Desktop & Screen Saver ->Hot Corners(right bottom)

--

--

Andrew Zhu
Andrew Zhu

Written by Andrew Zhu

Working on AI stuffs | a HF Diffusers contributor | a ex-Data Scientist@MS | His LinkedIn is www.linkedin.com/in/andrew-zhu-23407223/

No responses yet