I would like the MacBook not to sleep and or lock when closing the laptop lid. I would like to lock and sleep it only manually. Any ideas on how to do it?

  • There's already dozens of answers provided to prevent sleep when closing the lid. Please use the Search function to find and try the answers already provided.
    – fsb
    Dec 14 '18 at 14:38

To enable laptop sleeping with closed lid:

sudo pmset -b sleep 0; sudo pmset -b disablesleep 1

To re-enable laptop sleeping:

sudo pmset -b sleep 5; sudo pmset -b disablesleep 0

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