I want to be able to lock the screen quickly, and and the hot-corner thing is slow and tricky.
Using Keychain Access's Lock Screen menubar isn't fast enough for you?
Activate it here:
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.
Both shift-control-eject and option-command-eject (or power if you don't have an eject key) will sleep the display. You can require a password to wake from sleep in the Security & Privacy system preferences.
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)