At a Glance
Over the years, one of the most frequent reader requests I’ve received has been for a way to lock your Mac—in other words, to start the password-protected screensaver, or to put the display to sleep and require a password to wake it up—using a keyboard shortcut. This feature request is especially popular among “switchers” moving to the Mac from other platforms. You can enable OS X’s Keychain Access menu (from within the preferences window of the Keychain Access utility, found in
/Applications/Utilities), which lets you lock the screen using your mouse. Similarly, you can configure OS X’s screensaver to require a password, and then enable a hot corner for the screensaver; whenever you want to lock the screen, you just move the cursor to that corner of the screen. But some people really want to use the keyboard.
If you’re using a launcher utility such as LaunchBar, Butler, or Alfred, you can set up a keyboard shortcut that opens the application
/System/Library/Frameworks/Screensaver.framework/Versions/A/Resources/ScreenSaverEngine.app—the program that runs OS X’s screensaver. But that’s a roundabout method, and you may sometimes want to lock the screen without running the screensaver. You could use this old hint for setting up a keyboard shortcut for the Keychain Access menu’s Lock Screen command, but in my experience, the shortcut rarely works. There’s also this hint for creating an OS X service to start the screensaver using the keyboard, but it relies on OS X’s less-than-reliable Services feature—and, again, what if you want to just sleep the screen rather than start the screensaver?
You can press-hold Control-Eject (or, on a laptop, the power button) to bring up OS X’s Restart/Sleep/Cancel/Shut Down dialog, and then press S for the Sleep option (or, on some Macs, press Shift-Control-Eject or Command-Option-Eject to sleep immediately), but that puts your Mac completely to sleep—it takes time to wake it up again, and you may have processes running that you don’t want to stop. Another option is to press Shift-Command-Option-Q, which immediately logs you out of your account, requiring your account password to log back in. Thanks to Lion’s auto-resume feature, when you log in again, most of your programs and windows will be restored right where you left them. Still, this also takes time and interrupts processes, and it’s a bit of an extreme solution when you just want to lock your screen while you grab a beverage or use the facilities.
All of this is a roundabout—but, I hope, educational—way of saying that OS X doesn’t provide a simple, easy-to-use way to lock your screen using the keyboard. Which is where Padlock (Mac App Store link) comes in. This neat utility lives in your menu bar, just like the Keychain Access menu, but Padlock's menu lets you quickly start the screensaver or sleep your screen (without sleeping your entire Mac). Even better, Padlock’s preferences window lets you configure keyboard shortcuts for either or both of these actions.
Choose either of Padlock’s lock commands (I use Control-Option-Command-L to lock the screen), and a translucent padlock icon appears on the screen as confirmation. A few seconds later, the screensaver starts or your display(s) sleep, respectively. This confirmation graphic also serves a second purpose: Letting you know that you can cancel the lock action—say, if you accidentally pressed one of your Padlock shortcuts—by pressing Escape before the lock occurs. One drawback here is that you can’t adjust the length of time you get to cancel. Padlock gives you only three seconds, which, in the case of an accidental lock, often isn’t enough time to process the lock graphic and realize you need to press Escape.
Padlock can also automatically lock your screen when Padlock launches. This can be useful if you choose to start Padlock automatically when you log in: You can log in to your Mac in the morning and then go get a cup of coffee; as soon as OS X starts loading your Login Items, your screen is locked. It’s not bulletproof security, but it’s better than nothing.
Padlock’s other standout feature is that each time it launches, it confirms that your user account has a password (so the screen lock is actually a lock) and that your Mac isn’t configured to automatically log in to an account at startup (which would allow someone to access your account by simply force-restarting your Mac). If either of these conditions aren’t met, Padlock’s Security Assistant window warns you of the problem and presents a Help Me Fix It button. Click this button and OS X Help is launched to the particular Help page explaining how to set an account password or to turn off automatic login, respectively. Once you’ve fixed the problem, click the Check Again button and Padlock should give you an all-clear message. Once you’ve confirmed your Mac is set up properly, you can disable the Security Assistant check so it doesn’t appear each time you launch Padlock.
I wish Padlock’s onscreen confirmation graphic indicated which of its two locks—screensaver or screen sleep—you’ve just activated. But it’s otherwise a great utility for those of us who want to lock our Mac’s screen when we step away but who prefer pressing a keyboard shortcut to moving the mouse.
Updated 9/23/11, 9:45am, to clarify a couple keyboard shortcuts; 9/24/11, 3:25pm, to correct error about Padlock's menu-bar icon.