Close ad

Although OS X has many useful features and goodies, I personally miss one very important one - a keyboard shortcut for locking the Mac (something like Windows-L on Windows). If you have a username or stick icon displayed in the menu bar, you can lock your Mac from this menu. But what if you have little space in the bar or prefer a keyboard shortcut? You can use one of the third-party applications or create a shortcut yourself using our instructions.

Start Automator

1. Create a new file and select Service

2. In the left column, select Utility and in the column next to it, double-click on Run Shell Script

3. In the script code, copy:

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

4. In the script options, select Service does not accept no input ve all applications

5. Save the file under any name you like, eg "Lock Mac"

Open System Preferences

6. Go to Keyboard

7. In the tab Abbreviations select from the left list Services

8. In the right list you will find under In general your script

9. Click on add a shortcut and choose the desired shortcut, e.g. ctrl-alt-cmd-L

If you choose an inappropriate shortcut, the system will sound an error sound after entering it. If another application is already using the shortcut, it will take precedence and the Mac will not lock up. The instructions may seem quite "geeky", but everyone should be able to follow them. We hope that this guide will make your daily work more pleasant and faster.

Addition to the article:

We have inadvertently confused some of you with this guide and I would like to shed some light on the confusion. The article is really only intended for locking the Mac and needs to be distinguished from turning off the display and putting the Mac to sleep.

  • Lockdown (no native shortcut) – the user just locks their Mac, but the applications remain active. For example, you can export a long video, lock your Mac, walk away and let it do its job.
  • Turn off the display (ctrl-shift-eject) – the user turns off the display and that's all that happens. However, it may happen that the system preferences require a password when the display is turned on. In this case, the login screen will appear, but this is another functionality related to turning off the display, not locking the Mac as such.
  • Sleep (cmd-alt-eject) – the user puts the Mac to sleep, which of course stops all computer activity. It is therefore not a lock, even if the user may again have set password enforcement after waking up in the system preferences.
  • Logout (shift-cmd-Q) – the user is completely logged out and redirected to the login screen. All applications will be closed.
Source: MacYourself
.