brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: stop your MacBook from starting up when you open the lid

Macbook
~/tips/tip-macbook-stop-boot-on-lid-open

sudo nvram BootPreference=%01 # only block lid open

Keep a shut down laptop off until you press a key or button.

Open the lid of a shut down MacBook and it turns itself on. That is annoying when all you wanted was to wipe the keyboard.

Apple documents a firmware setting for this. In Terminal:

sudo nvram BootPreference=%00   # not on lid open, not on power
sudo nvram BootPreference=%01   # only block lid open
sudo nvram BootPreference=%02   # only block connecting power

Pick one line, type your password (nothing appears while you type) and shut down to try it. Pressing a key, the trackpad or the power button still turns the Mac on.

I would pick %01 if the lid is the only annoyance, so that plugging in the charger behaves as before.

To get the normal behaviour back, delete the variable:

sudo nvram -d BootPreference

It needs an Apple silicon laptop with macOS Sequoia 15 or later. Type the line exactly as shown: nvram writes to firmware settings, so this is a place to copy carefully and not to experiment with names of your own. And it only concerns a Mac that is shut down. Closing and opening the lid of a sleeping one still wakes it, as it always did.

Further reading: Prevent a Mac laptop from turning on when opening its lid or connecting to power

More Macbook tips System Settings > Battery > Battery Health > (i) when the display is off: on Slightly dim the display on battery: off System Settings > Privacy & Security > Accessories > Allow accessories to connect On power adapter: High Power Mode All Macbook tips (6) All topics

Link