'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspend
- use “Automator” create a service, then set the input as “no input”.
drag “Run shell script” to the editor in right side, then
'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspendsave the service as “lockscreen”
- set the shortcut key for the service in keyboard->shortcut keys