Locking screens on Macs with the keyboard

Desktop security is a big issue when you have access to massive amounts of data. As far as plain old terminal security, locking your computer while you’re away is a pretty basic rule.

We have lots of OSes around the office here – Ubuntu, Windows, and OSX. Of those, Ubuntu and Windows natively provide a way to lock your desktop with a keystroke (Win+L or Ctrl+Alt+Del, Enter on Windows and Ctrl+Alt+L on Ubuntu). Strangely, Mac gives no easy way to lock your desktop.

We’ve been using HotCorners for the screen saver, but who wants to touch the mouse if you don’t have to (especially when you’re racing to grab a free lunch)?

Enter Quicksilver, everyone’s favorite application interface. (There are all sorts of things you can do with Quicksilver and its various plug-ins, but you can look that up yourself.) To set up a keyboard shortcut with Quicksilver to lock your screen (hat tip to Bryan Helmkamp):

  1. Create a symbolic link to your screen saver application:
    $ sudo ln -s /System/Library/Frameworks/ScreenSaver.framework/Versions/Current/Resources/ScreenSaverEngine.app/ /Applications/Screen\ Saver.app
  2. Quicksilver -> Triggers -> Custom Triggers
  3. Add a Hotkey
  4. Find the ScreenSaverEngine by typing and press enter
  5. Double-click the cell in the Trigger column
  6. Choose your hotkey (I like Ctrl+Cmd+\ since it’s almost Ctrl+Alt+Del
  7. Close the window (you may also need to restart QS

Now set up your System Prefs in Security -> General to require a password immediately after screen saver begins and you’re set.

Sadly, you need to do this or your screen saver will awake as soon as you release your QS shortcut. This even happens if you set QS to launch screen saver “On Release”.

Anyway, after that, lock screen is just a keystroke away.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>