Friday, January 31, 2025

Preventing a Mac Laptop From Turning on When Opening Its Lid

Apple (via MacRumors):

A Mac laptop with Apple silicon automatically turns on and starts up when you open its lid or connect it to power. With macOS Sequoia 15 or later, you can change this behavior without affecting your ability to use your keyboard or trackpad to turn on your Mac.

[…]

  • To prevent startup when opening the lid or connecting to power: sudo nvram BootPreference=%00

  • To prevent startup only when opening the lid: sudo nvram BootPreference=%01

  • To prevent startup only when connecting to power: sudo nvram BootPreference=%02

This makes it possible to clean the keyboard with the Mac off and to prevent battery drain due to Power Nap by keeping it off instead of asleep. You can still power on the Mac by pressing the power/Touch ID key.

Dave Mark:

Interesting that this requires the Terminal, no setting to change this behavior. Plenty of other examples of this, but not used to seeing an official support document that sends you to Terminal as only path.

Previously:

Update (2025-01-31): Zsolt Benke notes that this doesn’t allow cleaning the keyboard because pressing a key will still start up the Mac. However, you can temporarily disable this:

  • Press and hold the left Control and Command buttons with right Shift button for a total of 7 seconds.
  • Without releasing them, press the Power button and hold together for an additional 7 seconds until your laptop shuts down. The login screen may flash for a second so don’t prematurely release the keys until the machine is off.
  • For your next startup, your Mac can only be powered on by using the Power button or closing and opening the lid.

This worked for me, but only if I didn’t close the lid before pressing a key.

4 Comments RSS · Twitter · Mastodon



If this is all so that you can clean the keyboard, then https://folivora.ai/keyboardcleantool is a free app for temporarily disabling keyboard input, from the dev of the awesome Better Touch Tool.


Zsolt's instructions are the same as resetting the SMC for a T2 Mac: https://support.apple.com/en-us/102605

Not sure why that would do anything on an M-series Mac, except that it is close to the process for entering DFU mode: https://support.apple.com/en-us/108900


@Alexander: There were probably changes between the different M-series silicons, since I could activate this on my M1 MacBook Pro, but not on a M3 Air.

Leave a Comment