📜 ⬆️ ⬇️

Lock Screen in Mac Os X

One day, I began to use mac os x as the main operating system. And since then, I sometimes find that some of the functions I’m used to are missing in one form or another. Working with computers for more than 10 years, I developed a strong habit of blocking the desktop, if I leave even for 2 minutes.

First of all, I decided to search in “Hot Keys”, in which you can configure almost everything, but there was no “lock” there. I had to search a bit, and as it turned out, there are several solutions. Conventionally, they can be divided into 2 ways. First, blocking through a password request to disable the screensaver. Second, a quick user change.

Lock screen saver


In order to enable a password request for disabling the screensaver, go to System Preferences-> Security and turn on the checkbox “Require password to sleep or screen saver”
image
It would seem, not a bad option, only to wait until it turns on is not at all interesting. The most annoying thing is that the simple (no third-party application) method of turning on the splash screen on any keyboard shortcut was not successful. Google, read, remember about Expose. You can activate the screen saver by moving the cursor to one of the corners.
image
For a very long time, this method was the most beloved.
')

Quick User Change


It turned out that not everything is so bad in the Danish kingdom, there is a switch between users that blocks the desktop to enter a password. It is also activated quite simply. To do this, go to System Preferences-> Accounts. Click on the image lock to authorize and enable the checkbox “Enable fast user switching”.
image
Now we have a beautiful icon to switch users.
image
We click on it and select the item “Login Window ...” and observe a cool effect when blocking.

Returning to the keys, moving zero, as normally, in one combination, switching users also does not work. Perversions with a chain of combinations will not even describe.

Quicksilver


After a while, I discovered the free quicksilver utility and its functionality for triggers that can be hung on hotkeys. And here I had the idea to write a small script to turn on the splash screen for the combination cmd + shift + L. For this we need:

1. Put quicksilver

You can download from quicksilver.en.softonic.com/mac , installation is trivial.

2. Write a script to start the screen saver

For writing, we use the standard application "Script Editor.app". Run and write the following text:

tell application “ScreenSaverEngine”

activate

end tell


It should look something like this:

image

3. Save the screensaver activation script

Save it where you like (I saved in the home directory), remember the way.

4. Add a trigger to the desired key combination

To do this, open the quicksilver tab triggers.

image
triggers in QS
Click on the plus sign at the bottom and select the Hotkey item. In the cell, add the script written in the previous step, as in the picture.
image

Bonus functionality


Later, an idea came to my mind, and why not also pause iTunes when the screen was locked? To do this, we just need to add these lines to the end of the script that launches the splash screen:

tell application “iTunes”

pause

end tell


With the new functionality, life becomes a bit easier.

Source: https://habr.com/ru/post/63444/


All Articles