Windows-L for the Mac.
The need
Coming to Mac OS X from Windows (XP and Vista), I missed being able to lock my session using a simple key-chord. I work in a shared office so it’s sensible to lock the session every time I walk away — something I do regularly.
In Windows, you simply press Windows-L and that’s it — time to go. Mac OS X Leopard doesn’t provide anything as succinct as standard, but there are ways.
Firstly, there are a couple of solutions that are accepted as standard ways of doing this — but unfortunately both have problems. I’ll cover these methods first in case they work for you, and then I’ll cover a solution that really is as quick and easy to use as the Windows’ lock screen key chord.
Partial solution number one: use a hot corner
A hot corner allows you to drop into the screen saver by moving the cursor to a chosen corner of the screen. To do this, first go to System Preferences->Desktop & Screen Saver and click on Hot Corners… Then select Start Screen Saver for one of the corners:
Now, when you place the cursor in that corner (I chose the bottom-left), the screen saver will start.
Of course, this doesn’t help unless your system is configured to require a password when woken from the screen saver. You can set that in System Preferences->Security:
And that’s it. Now, before you walk away from your Mac, just drop the cursor into the bottom-left corner of the screen.
However, there is a problem with this method — at least for me — as I don’t want the system to prompt for a password on wakeup. I end up typing my password far too often — every time I’ve left the machine alone long enough for the screen saver to start.
What I want is the Mac to remain unlocked until I explicitly lock it. So, on to solution two…
Partial solution number two: select a pull-down from the menu bar
Here’s another way of locking the machine, and this one doesn’t require that you tick Require password to wake up this computer from sleep or screen saver.
The trick is to enable fast user switching in System Preferences->Accounts->Login Options:
which will then place your user name in the menu bar at the top of the screen.
When you want to lock the session, just click on your user name:
and select Login Window… and you’re done. (You can also achieve a similar result by ticking Show Status in Menu Bar in Keychain’s preferences if you prefer.)
What’s my beef with this solution? The problem is that it’s still rather slow and fiddly — and it’s something I do regularly, so I want to just press and go, just as I did with Windows.
A full solution
To implement a full Windows-L style solution we need Dockables to provide us with an application that locks the Mac OS session, and Quicksilver to launch that application.
First, download and install Dockables from cocoaapp.com. This gives you a bunch of useful applications in a sub-folder of your Applications folder:
and the one we’re interested in is Lock Screen.
Next, download and install Blacktree’s Quicksilver and run it to configure a new Lock Screen key-chord. Quicksilver will present you with its main window — just quit that and instead move to Quicksilver’s menu bar at the top of the screen and select Triggers… from the drop-down menu.

In the Triggers window that appears, click on the + at the bottom and select HotKey.

A new window will appear. Click on the first field and start to type lock screen. Quicksilver will rapidly find the Lock Screen dockable you installed earlier. Click Save.

Nearly there
You now have a new command, but with no trigger. So click on the None in your new command,
click in the input field labelled Hot Key: and press the key combination you wish to use to lock your session from now on. (I chose alt+cmd+L because the obvious choice – cmd+L — is already used by Thunderbird — my email client.)
I suggest you don’t use the ctrl key as part of your hot key-chord. If you do then quicksilver presents this dialog every time you type the chord:
Now, having typed a key-chord (which doesn’t include ctrl), exit the Triggers window and you have yourself a new Lock Screen hot key-chord: alt+cmd+L in the example above.
And finally, tweak some settings
You need quicksilver to run at all times, so bring up Quicksilver’s preferences (available from the Quicksilver menu in the menu bar at the top of the screen):
and tick Start at login. You may also want to tidy up the dock a little — as quicksilver is running all the time I’d rather it didn’t appear in the dock and instead appeared in the menu bar:
so I untick Show icon in dock (and I also tick the option check for updates):
And that’s everything sorted. Any time you need your display locked, just type alt+cmd+L…

and walk away…
Related posts
- Keyboard driven dialog boxes and menus in Mac OS X Want to use keyboard accelerators to drive dialogues etc. in Mac OS X? Here's how....
- Want to stop Vista prompting for a password on wakeup? Windows Vista prompts for you password every time it comes out of sleep / hibernation. If you'd rather it didn't...
- Efficient backups: storing VMs in a sparse bundle Using a virtual machine -- perhaps VMware Fusion or Parallels Desktop -- can result in way-too-large backups. Here's one way...





Do you Tweet? If so, feel free to
How long did that last photo take you to do?
About an hour from start to finish — high art takes time you know.
I would like the keypress functionality to lock screen t come with the minimum of. installables. I don’t see a way to get past the need for something like QuickSilver as the Mac built-in key launching seems useless at best.
However… You do not need Dockables. You can simply just launch the ‘ScreenSaverEngine’ app to lock your screen located at:
/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
(I’ve dragged this to my Dock for quick one-click locking so far, but have been unable to bind a key to it)
So for Quicksilver users this is possible, but I’ve stopped using Quicksilver and am used to just using Spotlight. (I try to limit my dependence on extra apps)
Thanks Mark! This is exactly what I was looking for and works perfectly.
Good stuff. Most people don’t comment, but being of an optimistic disposition I have to assume people find it useful.
Mark
Thanks Mark. Great Article. Keep posting such articles.
Thanks for this tip. Unfortunately, it doesn’t work perfectly. if I double click on the dockable it works fine, if I launch it via QS it works fine, if I launch it using a QS trigger though I get a confirmation box asking me if I want to launch the app or quit…wierd..
Hi – that’s one of the modifiers you’re using for your key-chord doing that (from memory, ctrl?) – that’s why I used cmd+alt. I guess I should check that out and add the information to the article, but in the mean time try cmd+alt+L as the key-chord and that dialog won’t pop up.
Mark
Yay! It worked
I changed the trigger from ctrl+cmd+L to alt+cmd+L and no popup appeared. I still did not understand why ctrl+cmd+L wasn’t working though..
Anyway, Thanks a lot!
I suppose the ctrl key must be used by Quicksilver to signify that you want confirmation of an action.
OK, I’ve changed the article to steer people away from using ctrl as part of their key-chord.
Excellent tip! Thanks. I use cmd+L with a delay for 0.5 seconds – long enough not to collide with other applications using cmd+L while still short enough for me to wait
iAlertU – a car alarm for your Mac finally putting your Mac’s remote to good use (http://www.versiontracker.com/dyn/moreinfo/macosx/29578; it’s FREE and it works!) – is far simpler: download, install, start up, configure (set your preferences), and run.
And it’s DARN effective!
I run iAlertU on MacBook Pros in varying office and semi public access settings. Whenever I’m somewhere new I make sure the chirping sound is clearly audible when I arm iAlertU for the first time so that everybody within 80 feet gets the message. And that seems to do it. The siren has never yet screamed it’s head off ‘in earnest’ in the past 18 months. I would say that is effective, wouldn’t you?
Ideal if you need to step away for a cup of coffee, a smoke outside, or a full service visit to the bathroom.
Have fun!
Great posting!
Fast to install, easy to handle, thank you!
[...] OSX: not quite as easy, but still doable. See these instructions. Tagged with: easy, lock, mac, screen, security, shortcut, windows no comments yet « [...]
But what if I want to lock my keyboard, and not blank my screen?
Just a quick note to say thanks for this. I know it’s only a little thing, but it means I can turn hot corners off now
I have switched to mac from windows because of my new job, and I have to say this is just one more thing on a long list of things that OSX does (rather, doesn’t do) that really pisses me off.
Anyway, I use synergy at work to share my keyboard and mouse between the mac and my other computer (linux box). Locking the screen this way causes the synergy client on the mac to suspend as well, meaning I have to use the laptop’s keyboard to log back in. When using the hot corner/screen saver method, synergy still works.
Also, is there really no way to have ctrl as part of my hotkey sequence without that stupid dialog? My linux box is set up to use ctrl-alt-L. I’d like to have them the same on both machines.
I don’t know of any way of disabling or re-assigning the ctrl key’s function in quicksilver I’m afraid. (Does anyone else reading this know?)
As an aside, I’ve found that whenever I change technology (particularly when forced to do so), I notice what is doesn’t do compared with my old way of doing things. Anything new / better doesn’t slap you around the face and interfere like something that’s missing or done differently does, so the minuses tend to be more obvious than the plusses, at least in the short term…
Thank you just what I was looking for. Just switched back to a Mac after 20+ years of working on a PC and need my familiar apps and functions.
Mark. Thanks for that article. I decided to go with the simple version (login window menu item…)
Really was perfect – however your link to dockables needs to be updated. http://getdockables.com/
Thanks Yoni — I’ve updated the link.
As of Mac OS X 10.6 Snow Leopard, there is one more way to accomplish this, without any extra or third party software.
Use Automator to create and save a ‘Start Screen Saver’ service that accepts no input and is available to all applications. You can find the appropriate Automator action under ‘Utilities’. Then you can simply assign this new service a shortcut from the Keyboard Shortcuts preference pane.
If you would prefer to lock the screen rather than use a screen saver, use Automator to run a shell script with the following command:
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Then set the keyboard shortcut as before. Huzzah!
See this (more general) tip:
http://www.macosxhints.com/article.php?story=20090903085255430
Hey Mark, Thanks man, this is the first time i replied to a useful post saying thankyou.. you truly deserve it.. ive been lookin for this for AGESS