5

My MacBook Pro is connected to two external monitors using a docking station. The internal screen lid is constantly closed and I don't usually use it. I only use the external screens.

The problem is that whenever I disconnect the power adapter (while the lid is closed), it triggers a sleeping mode. Therefore I can't unplug the AC adapter and keep working. I would like to prevent my computer from sleeping when the lid is closed and the power is unplugged. Did anyone face this issue and found a solution?

Additional Details:

enter image description here enter image description here

enter image description here

Remark

Before I opened this thread I found this similar question: https://apple.stackexchange.com/questions/261784/how-to-prevent-screen-lock-when-macbook-ac-adapter-is-unplugged. However, the solution there does not fit my needs, as it prevents the computer from sleeping at all (which is not my intention).

3 Answers 3

3
  1. Open Terminal.app
  2. Type in the command sudo pmset disablesleep 1
  3. Enter your password to authorize the change to the power management settings.

Note: Tested with m1 macbook air, but it should work on other models as well,
and you can run sudo pmset disablesleep 0 to restore setting


Source: https://developerinsider.co/prevent-external-monitor-to-sleep-when-macbook-ac-adapter-unplugged

2
  • 1
    Wouldn't it prevent mac from sleeping entirely? I am looking for a solution in which the computer still gets asleep after x minutes of idle
    – Ido
    Commented Mar 25, 2023 at 9:29
  • AFAIK, yes. Maybe try use ifttt or shortcut to trigger disablesleep 0 on screen saver shows and trigger disablesleep 1 when unlocked, just a quick thought not tested
    – Bear.Y
    Commented Mar 25, 2023 at 11:05
0
  1. Click the Apple icon in the upper left corner.
  2. Click System Preferences.
  3. Click Battery.
  4. Click Power Adapter.
  5. Click the slider and move it to Never.
  6. Click the Prevent computer from sleeping automatically when the display is off check box.

Source: https://www.lifewire.com/prevent-macbook-from-sleeping-when-lid-is-closed-5203069

2
  • 1
    Hi, thanks for your answer but it does not work. The moment I unplug the power adapter - both external monitors turn off and the Mac gets locked. Even if I press keyboard keys and move the mouse around they won't turn back on. In addition, this solution has an undesired side effect: when the power adapter is plugged and the computer is idle, it will never go to sleep and the monitors will be kept on.
    – Ido
    Commented Jun 2, 2022 at 13:13
  • this does NOT work anymore, these kind of answers should disappear from the internet
    – IceFire
    Commented Jan 21, 2023 at 11:49
0

You could use the free Amphetamine app to keep your computer awake for a specified amount of time, or while a specified app is running.

3
  • So this means there's no native way to keep a MacBook running while connected to an external monitor, lid closed, and unplugged from an AC power source. Is my understanding correct? Commented Oct 4, 2022 at 12:24
  • 1
    That's correct, as far as I know.
    – DPG
    Commented Oct 7, 2022 at 1:18
  • No, it's wrong. Lid closed will bring it to sleep even with this app
    – IceFire
    Commented Jan 21, 2023 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .