1

90% of the time I work with my macbook connected to a screen.

I want my macbook to go to preferably lock, but will settle for sleep, when I close it.

I don't care if it is doing anything, if I close the lid, I want the entire machine to lock/sleep.

This does not seem to be possible from what I can tell but I am hoping that you can prove me wrong.

Is there an application or automation to help me secure my system when the lid shuts?

1

4 Answers 4

2

Sadly I don't think you can invoke this behavior and this is not the solution you are asking for, though as I imagine you are using a keyboard (apple?) you could always use the hotkeys to lock your laptop and screen.

  • OptionCommandPower / OptionCommandMedia Eject: Put Mac to sleep
  • ControlShiftPower / ControlShiftMedia Eject : Put display(s) to sleep

https://support.apple.com/en-us/HT201236

1

There is a script to do so: https://github.com/pirj/noclamshell

How does this work

It periodically checks if lid is closed and puts machine to sleep. Nothing fancy, it uses command line tools that come with OSX, specifically ioreg, which displays I/O registry and pmset to manipulate power management settings.

brew install pirj/noclamshell/noclamshell
brew services start noclamshell
1

There is Clamshell app in AppStore that can run following actions when laptop lid is closed:

  • Sleep
  • Immediate Shut Down
  • Turn Off Displays & Prevent Idle Sleep
  • Keep External Displays On & Prevent Idle Sleep
0

There’s not a reliable way to disable closed clamshell. Instead, I would use the key command to lock the screen before you close the lid and set screensaver to need a password immediately.

Control-Command-Q: Immediately lock your screen

You can mess with sleep automations or apps (several have been mentioned here already), but without a lock your Mac is now less secure.

You must log in to answer this question.

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