Home » Questions » Computers [ Ask a new question ]

Is there a keystroke that can lock the Mac OS X screensaver?

Is there a keystroke that can lock the Mac OS X screensaver?

On Windows I can hit Windows + L to lock my desktop. On Leopard there doesn't seem to be this capability. While I can set the screensaver to come on very quickly, I would like to hit a key combo to lock my computer.

Asked by: Guest | Views: 241
Total answers/comments: 5
Guest [Entry]

"Modern update for posterity, no additional software is required to do this. It's built-in in a number of ways.

Default Shortcut

There's a default global shortcut as a modifier of the typical ""quit"" shortcut to perform this action, visible against the Apple menu item Lock Screen: ⌃⌘Q (Control Command q)

Pressing this keyboard shortcut combination or selecting this entry from the Apple menu will instantly lock your display.

Customizing the Shortcut

Menu-based actions can be remapped by the user under Keyboard System Preferences, Shortcuts tab. Use the App Shortcuts section, click the + button, define a new keyboard shortcut, and use the Menu Title of Lock Screen. In this way you can add or change shortcuts for any menu-accessible action in any application. An example: I have ⌘K (Command k) mapped in iTunes to the Subscribe to podcast… menu item, to match Finder's Connect to server… shortcut.

Idle Locking

To automatically lock your display after a period of inactivity when the screensaver becomes active, configure that under Security & Privacy System Preferences. It's often convenient to not set this to Immediate to account for accidental screensaver activations, e.g. if reading a particularly dense textbook errata online or accidentally activating a ""hot corner"".

To make this directly usable as an action, you can utilize the ⌃⇧⏏ (Control Shift Eject) shortcut, or configure a ""hot corner"" to immediately trigger the screensaver under Desktop & Screen Saver System Preferences. This will allow you to ""throw"" your mouse into a corner of the screen as the shortcut. (This is a nod to a classic feature, dating back to one of the original screensavers on the original 1984 Macintosh: After Dark, and before that, an analog clock screensaver and a black and white fireworks demo. Upper right to activate, lower right to prevent.)

Touch Bar

Touch Bar equipped MacBook Pro notebook computers can be configured to provide a ""Lock Screen"" button in the right-hand ""control strip"" (amusingly, this name also dates back to Classic Mac OS 8 or 9…) by using The ""Customize Touch Bar…"" action under Keyboard System Preferences.

Drag the Screen Lock action into the control strip portion of the Touch Bar.

Old Method: Keychain Access

Keychain Access used to offer an option to display a lock icon in the menu bar, next to the clock. This would give you access to locking the display as well as explicitly locking your keychains (forgetting your saved account password in-memory). Apple appear to have removed this feature.

Old Method: Fast User Switching

This is a creative way to trigger essentially the same effect as ""locking"" your screen, tackled from an entirely different direction. If you enable ""Fast User Switching"" you can gain access to the login screen without actually logging out entirely. The option can be enabled from the Users & Groups System Preference panel, Login Options, check the checkbox.

To make this accessible by keyboard shortcut will require some extra work. For step by step instructions to accomplish this (using Automator and a command-line invocation within), please see this other Superuser answer.

Third-Party Software

A use case Apple have not covered, yet, is automatic locking based on physical proximity. They have unlocking down pat with the Allow your Apple Watch to unlock your Mac option, which is excellent, if you happen to have one of those devices. The reverse is desperately needed, though! (At some companies, leaving your workstation unlocked is a firing offence!)

Luckily, there are solutions available, though they range wildly in effective difficulty level to implement and use. I'm a true UNIX geek, and appreciate power and flexibility first and foremost, so I'm a fan of solutions like Proximity combined with Apple Script / Automator. There are also solutions like Keycard (App Store link), but that particular choice also introduces additional insecurity: ""PIN unlock"" as a fallback mechanism, instead of your actual system password and standard password entry screen. A helpful guide to both approaches is available.

The most consumer-friendly, though not free, option I have found so far is Unlox. It additionally supports Bluetooth Low-Energy (BTLE) by using a companion app on the device itself. (A requirement to utilize this more power-efficient technique.)"
Guest [Entry]

Control-shift-eject will blank the screen. If you wait until.. mmm.. sometime later this year... you may find that it also locks the screen...
Guest [Entry]

"Here is an easy implementation:

Open the KeyChain access application
Open its preferences from Keychain Access -> Preferences
Select ""Show keychain status in menu bar""

At this point all you have to do is click on the little keylock icon and select ""Lock Screen"", but here is something extra for more fun:

Open Automator
Create a New ""Workflow""
Click on the ""Record"" button
Now record yourself selecting the keylock and then the ""Lock Screen""
option
At this point your screen saver will kick in, so press ESC and log
back in
Stop the recording
In the recorded steps, delete any recorded steps after ""Lock
Screen"".

(It doesn't hurt to test it now by pressing the ""Play"" button)

Now save your Workflow.
Create a new Automator file (press Cmd + N)
This time choose a new ""Service""
In the search on the left hand side look for ""Run Workflow"", then
drag and drop it to the right hand side
In the ""Workflow"" drop-down select ""Other..."", and locate the
Workflow you saved above.
Make sure at the top of this Service that you select ""no input"" for
""Service receives""

(Test some more)

Now comes the real ""magic""

Now save your Service (give it a human-readable name like ""Lock My
Screen Service"")
Go to the ""APple Menu"" and open up ""System Preferences""
Select ""Keyboard""
In this section choose ""Keyboard Shortcuts""
Select ""Services"" on the left
On the right hand side scroll all the way to the bottom under
""General"" and you will find ""Lock My Screen Service""
There is a grayed-out text to the right that says ""none"", which
means that no shortcut has been assigned, so click on it and an ""add
shortcut"" button appears. Click on it.
Now press your desired combination (i.e. Ctrl + Alt + Cmd + L)
Done. Close out and test it by pressing the button.

If you tested and followed this carefully, pressing the shortcut above will load the Service you created in Automator which in turn runs the workflow which moves the mouse to the Keychain menu and locks the screen for you."
Guest [Entry]

"Edit security settings to require a password to wake up from screen saver, throw this line into an apple script:

tell application id ""com.apple.ScreenSaver.Engine"" to launch

If you have quicksilver you can then setup a trigger to launch the applescript using whatever keystroke you like. Or you can add it as an application specific script ~/library/application support/""application name""/scripts and then use the built in MAC keyboard shortcuts to launch the script via that applications menu items."
Guest [Entry]

Configure screen saver password and press Shift + control + eject