Many Windows-users know (and remember switchers) keyboard shortcut Windows + LThat in a moment "puts lock" on PC-based computer to restrict unauthorized access to it, while the owner was away. In OS X this function, unfortunately, still does not appear, even though all the necessary tools at hand for a long time. It remains to create their own service, which will block the Mac is as easy - with a single click the desired key.
Creating Automator service
Of course, the easiest way to do this using Automator program, which is free and available to every more or less modern Mac. Create a new document, selecting for him the type of Service (Service). The "cap" set the algorithm, so that the service has not received no input (no input) and worked in any application (any application).
The body of the algorithm, add one single action - Run the shell-script (Run Shell Script). Make sure that the drop-down list Shell was selected /bin/bashAnd the list Transmit input (Pass input) - point in stdln (to stdln). Inside action paste the following code:
/ System / Library / CoreServices / "Menu Extras" /User.menu/Contents/Resources/CGSession -suspend.
Save the service, for example, under the name Block Mack (Lock the Mac).
Binding shortcuts
Established service will be available in the main menu of any Mac program - in the Services group (Services). To simplify it a challenge, it is possible to assign a keyboard shortcut.
Start the "System Preferences» (System Parameters), and open the module Keyboard (Keyboard). Here tab Shortcut keys (Keyboard Shortcuts) and in the left list, select Services (Services). After that, the right of the list, in the categoryBasic (General)Click on the name of the newly created service - Block Mack (Lock the Mac).
You will see a button add mix (add shortcut) - click on it and immediately enter the desired keyboard shortcut. By analogy with Windows + L could choose command + LBut this combination of keys used by many Mac programs. Therefore better to introduce, for example, command + control + L (⌘^L) - check only, if not used, and a combination in which any of your programs.
If everything is in order, then immediately at the touch of the keyboard shortcut you turn the Mac into the login mode: next to your name will orange circle with a check mark, which means that OS X, your account is currently active, and only need to enter your password to return to the system.
[Added] An alternative method
The commentary is another method to lock the Mac. Open the "System Preferences» (System Preferences), the module Protection and security (Security & Privacy). Here, select the option ... Require a password when exiting from sleep or screen saver (Require password... after sleep or screen saver begins). In the drop-down list, select immediately (immediately)To lock the system took place as soon as the start screen saver or turn off the display. The same function works if display is turned off manually with the key combination control + shift + eject. The only disadvantage of this method lies in the fact that in some cases you may need only put out a screen - without further password. If you think this method is not convenient, use the above method of creating service "Avtomatora".