I want to be able to lock the screen quickly, and and the hot-corner thing is slow and tricky.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The automator script works, but there is a delay between when I hit the key-combination, and when it locks up, especially if the currently activated application is busy (and I usually like to start some big task, like a build, right before I walk aay from my desk).
Control-shift-eject (or control-shift-power) puts displays to sleep and option-command-eject (or option-command-power) puts a Mac to sleep. Both lock the Mac if this option is selected:
Another way to lock a Mac is to log out to the fast user switching screen. You can assign a keyboard shortcut for it with Alfred:
Or just assign a shortcut to
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend.
If you use the new MacBook Pro, use a program like Karabiner Elements to map from a key you choose to "Eject", so that the good old CTRL-SHIFT-EJECT works.
This method works also with external / Windows keyboards (no Power key)