If you need to temporarily leave your Mac unattended, you need to lock your Mac screen before leaving it. In a less secure environment, lock Mac screen will help you to protect the data that you have. Because it’s better for you to prevent other people trying to do bad things to your data.
There are many ways to lock your Mac screen; the best way is to press the keyboard shortcut. With it, you can do it quickly and instantly displays the login screen without having to close one of the things that you do. So, how to lock Mac screen with a keyboard shortcut?
Create Lock Screen Service
- Open Automator from your Applications folder.
- Then Select Service as the document type to create a new service.
- Under the header Service Receives: select no input in any application.
- In the left pane select Utilities, then double-click the Run Shell Script is in the right panel.
- Type the following script into the command box that appears.
/System/Library/CoreServices/”Menu Extras”/User.menu/Contents/Resources/CGSession –suspend
⌘Sand name your service as Lock Screen. Once saved, you can close the Automator.
Assign a Keyboard Shortcut
- Open up System Preferences and Keyboard, select the Keyboard Shortcuts tab.
- Next, of the left pane select Application Shortcuts. Click on the plus (+) to add a new shortcut.
- In the dialog window set like this.
- Application: select All Applications, because we want to leave all applications when the shortcut is executed.
- Menu Title: Enter Lock Screen as the Menu Title. Please note, you must enter the same name when saving the name service in Automator.
- Keyboard Shortcut: please fill it with
Ctrl+Cmd+L(I use it). Please note, that you enter is the shortcut key to press when you want to lock your Mac screen.
- Click Add to apply these settings on your Mac computer.
To lock your Mac screen, now you just need to press
Ctrl+Cmd+L, then Mac login screen will be displayed. You do not need to worry when leaving your Mac unattended. No one can access your account until you enter the login password.