Modern MacBook Pro and MacBook Air laptops are engineered for instant readiness. Opening the laptop lid immediately triggers the internal hall-effect sensor, waking the machine from sleep or powering it on from a cold shutdown. While convenient for quick work sessions, this default behaviour can be frustrating when you simply want to wipe down the keyboard, clean the Retina display, or pack the device into a tight laptop sleeve without risking accidental battery drain or overheating. Fortunately, using native macOS Terminal commands, you can configure your power management settings to stop your MacBook from automatically waking when the lid is opened.
Understanding macOS Lid Wake and AutoBoot Behaviour
Apple laptops manage power states using two distinct subsystem mechanisms:
- Lid Wake (
lidwake): A power management configuration parameter managed by the macOS power management service daemon (pmset). When enabled (the system default), opening the physical display hinge signals the kernel to transition the Mac from sleep to an active state. - AutoBoot: A firmware-level NVRAM variable present on both Intel and Apple Silicon Macs. When enabled, connecting an AC power adapter or lifting the clamshell lid automatically executes the pre-boot sequence even if the machine was completely powered off.
By adjusting these parameters, you regain full control over when your Mac powers up, requiring an explicit press of the Power or Touch ID button before the display illuminates.
Step 1: Check Your Current Power Management Settings
Before modifying system power settings, verify your existing configuration to see how your MacBook currently handles sleep, battery, and wake triggers.
- Open Terminal on your Mac (press
Command + Space, typeTerminal, and pressReturn). - Enter the following command and press
Return:pmset -g - Review the printed list of power management flags. Locate the line labelled
lidwake. A value of1indicates that lid wake is active, whereas0signifies that the feature is disabled.
Step 2: Disable Automatic Lid Wake Using pmset
To prevent your MacBook from waking from sleep when opening the lid, use the command-line utility pmset with administrator privileges.
- In the Terminal window, execute the following command:
sudo pmset -a lidwake 0 - When prompted, type your macOS administrator password and press
Return. Note that Terminal does not display characters or asterisks while typing passwords for security reasons. - The
-aflag applies the rule across all power modes, including battery power, AC charger connection, and UPS backups. - Verify the change by running
pmset -gagain. Thelidwakeentry should now display0.
Once configured, closing your MacBook will send it to sleep as normal. However, opening the lid will no longer illuminate the screen. To wake the machine, simply press any key on the keyboard, click the trackpad, or tap the Touch ID button.
Step 3: Disable AutoBoot on Intel-Based MacBooks
If you own an Intel-based MacBook (manufactured prior to November 2020), shutting down the computer and opening the lid will still boot the computer unless you disable the firmware’s AutoBoot variable.
- In Terminal, execute the following command to alter the NVRAM variable:
sudo nvram AutoBoot=%00 - Enter your administrator password to confirm.
- Restart your MacBook to apply the new firmware parameters.
Note for Apple Silicon (M1, M2, M3, and M4) Macs: On Apple Silicon machines, the Unified Boot firmware closely integrates hardware sensor telemetry with the Secure Enclave. While sudo pmset -a lidwake 0 successfully prevents sleep-wake cycling, cold booting upon lid opening is hardwired into the platform’s hardware controllers and cannot be completely overridden in every macOS version.
How to Revert to Default MacBook Lid Wake Behaviour
If you decide to restore the original factory behaviour so your MacBook wakes immediately upon lifting the display, you can re-enable both settings with two quick commands.
- Open Terminal.
- Restore the power management lid wake flag:
sudo pmset -a lidwake 1 - If you modified NVRAM on an Intel MacBook, restore the AutoBoot parameter:
sudo nvram AutoBoot=%03 - Press
Returnand enter your administrator password. Your Mac will immediately resume its original instant-on behaviour.
Alternative Solutions for Cleaning Keyboards and Screens
If your primary motivation for disabling lid wake is to clean dust, smudges, and fingerprints from your keyboard without triggering unwanted key inputs or waking the operating system, consider these practical alternatives:
- Use a Keyboard-Locking Utility: Lightweight open-source utilities like KeyboardCleanTool or CleanMyDrive lock keyboard input completely while your Mac remains powered on, allowing you to wipe keys safely without shutting the clamshell lid.
- Lock Screen Shortcut: Press
Command + Control + Qto lock your Mac screen immediately, or explore how to enable key repeat settings in macOS to customise keyboard responsiveness. - Dim Display to Zero: Repeatedly press the brightness down key (
F1) until the screen backlight powers off entirely before cleaning display glass.
Modifying your MacBook’s lidwake setting grants you total authority over your hardware, eliminating unwanted wake events and protecting battery longevity whenever your laptop is in transit.