MacOS – Keyboard shortcut for locking screen in macOS Sierra

keyboardmacosshortcutsleep-wake

In previous versions of OSX, I could use Ctrl Shift Power on my built in keyboard, or Ctrl Shift Eject on my (old) Apple bluetooth keyboard to lock the screen.

After upgrading to Sierra, that shortcut stopped working. Using Karabiner-EventViewer I discovered that pressing the built in power button triggers SysKey 0x6, and the Bluetooth keyboard Eject triggers no events.

Whats going on, and how can re-enable that shortcut?

Best Answer

There are different ways to lock your screen.

Note: These shortcut tips are for Sierra and below. In High Sierra, there is a new entry under the Apple Menu (with shortcut) to lock the screen.

1. Use keychain

Open keychain -> Settings. Choose from there Show keychain status in menu bar.

enter image description here

You can now choose from the menu bar to lock your screen.

enter image description here

With this option, you need your password to log in next time.

2. Use Hot Corners to lock your screen

First, go to your System Settings -> Desktop & Screen Saver and choose Hot Corners on the bottom right.

enter image description here

Next, choose one of the corners the option Put Display to Sleep. I prefer bottom right, but this is by each user different.

enter image description here

That's all. One note: You can configure in the Privacy Settings when the display will be locked. For example, if you have it set to five minutes, you need to enter your password after the time in your setting is gone. You can change this to immediately, for example.

enter image description here

3. Lock Screen (with Shortcut)

Because @Flimm asked for a shortcut to lock the screen, here is a solution below High Sierra.

Usually, there are two solutions. You can use CTRL+Shift+Power Button or

CTRL+Shift+Eject-Key to lock the screen.

Both solutions are not my favourites, and for that reason, I've created a Shell Script with Automator. Thanks to Taylor who gave me this hint.

  1. Open Spotlight and type Automator to open the Application.
  2. Create a new Document.
  3. Choose Service to make as global Service.
  4. On the left Pane, choose Utilities; and on the right column, double-click Run Shell Script. You see a Window with the Cat-Command.
  5. Delete the cat-Command and copy & paste the following Shell-Script into the empty Window:

/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

Make sure that on the top right of the Automator-Window, both pull down-menus are set as no input in any application.

  1. Click on the top right to the Run-Button (marked with green circle) and test if it works.
  2. Save your workflow now as Lock Screen, for example.
  3. Open System Preferences, Keyboard and click on the Button Shortcuts or Keyboard Shortcuts.
  4. Choose on the Left columns Services and search for your saved workflow.
  5. Add your favourite Shortcut (e.g. I have Cmd + Alt/Opt + L).

For better understanding, I have put the pictures below.

enter image description here

enter image description here

Apple Support Documents Mac Keyboard Shortcuts