Create a screen-locking keyboard shortcut
Jul 15, '05 06:53:00AM
Contributed by: ct77
I use both an iBook and a Windows-based laptop at work, and it's a must for me to lock the screens on both machines before leaving my desk. I'm a keyboard shortcut junkie, and I quickly became envious of the Ctrl-Alt-Del-Spacebar combo that I could use in Windows XP to swiftly lock the screen (muscle memory is a great thing). So I worked out the following method to enable a keyboard shortcut that locks the screen in OS X -- and no scripting or work in the Terminal is required.
- Open the Keychain Access application (/Applications/Utilities/Keychain Access).
- Open the Preferences panel (menu: Keychain Access->Preferences).
- Make sure "Show Status in Menu Bar" is enabled.
- Now close the Preferences panel and then the Keychain Access application.
If you click on the Keychain Access menu extra that should have appeared in the menubar (it looks like a tiny lock), you can try pressing the "Lock Screen" option: this will, as you'd expect, lock the screen.
The next part of this hint involves assigning a keyboard shortcut that will activate the Lock Screen option of the Keychain Access menu extra.
- Start System Preferences (/Applications/System Preferences).
- Click on Keyboard & Mouse.
- Click on the Keyboard Shortcuts panel.
- Under Application Keyboard Shortcuts -> All Applications, click the "+" sign (lower left corner) to add a shortcut.
- For Application, choose All Applications.
- For Menu Title, enter Lock Screen
- In the Keyboard Shortcut field, press Control-F9 (press the Control key first, hold it down, then press the F9 key), then click Add.
- Before leaving the Keyboard Shortcuts panel, scroll up and find the "Move focus to status menus in the menu bar" entry. On my default install of Tiger 10.4.1, this shortcut is defined as ^F8 (Control plus the F8 key).
Now close System Preferences, then log out and log back into your user acccount. Once you're logged back in, hold down the Control key, press F8, then press F9. If I haven't missed anything, you should now be looking at your screensaver.
[robg adds: You can skip the logout/login step if you open the Terminal and type killall SystemUIServer. When I wanted a fast way to lock my screen, I used Butler to create a keyboard shortcut to the login window -- when I press my shortcut keys, up pops the login window. However, the method in this hint works, doesn't require any third-party software, and it's free...]
Comments (50)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050706194219822