- Sleep
FruitMenu has a menu item for sleeping by default. I added it to my menu and assigned a key combo to it. Note: I've found that key combos that use the [command] key do not always register. This may be a bug, but more likely, it's due to a foreground app taking priority for the key combo. Hence, I assign combos with [ctrl] and [option] together.
- Lock
Locking is implemented through the Screen Saver as usual. I set my Screen Saver to "Never" launch in the preferences, but to require a password. Then I dragged /System -> Library -> Frameworks -> ScreenSaver.framework -> Resources -> ScreenSaverEngine to the FruitMenu. I renamed it to "Lock Workstation" and assigned a key combo.
- Both sleep and lock
Open the AppleScript Script Editor and enter the following script:launch application "ScreenSaverEngine"
Then Save As Run-Only, select "Application" under Format, and check "Never Show Startup Screen." I saved it as "Lock & Sleep Workstation". For vanity, I changed the icon to the Keychain icon as well. Finally, I dragged my newly created application to my menu and assigned it a key combo. Naturally, you can also put this application into your dock and launch it from there, or any other launcher application.
delay 5
tell application "Finder"
sleep
end tell
[Editor's note: I think bits of this have been repeated in previous hints, but this is a nice summary of three different keyboard-based solutions for sleeping and/or locking your machine.]

