Wednesday, July 13, 2011

OS X: Lock the screen via a keyboard shortcut

Update: There’s actually a default shortcut: Ctrl+Shift+Eject.

What I did to undo what I did below:

  1. System Preferences: Keyboard » Keyboard Shortcuts » Uncheck “Start Screen Saver”
  2. Finder: Home » Library » Services » Delete “Start Screen Saver.workflow”

    Applications » Automator

    1. Choose “Services”
    2. On top-right: Service receives [no input] in [any application]
    3. Search for “Start Screen Saver” on the left and drag it to the right
    4. File » Save and name it “Start Screen Saver”

    System Preferences

    Security » General

    1. Check “Require password” [immediately]

    Keyboard » Keyboard Shortcuts

    1. On the left, select Services
    2. On the right, in General » Start Screen Saver
    3. Double click on the right of the name (in the “invisible shortcut column”)
    4. Assign the key combinaison (I use Ctrl+Alt+Cmd+L, Cmd+L doesn’t work)

    Complete article on Mac OS X Hints.