Lock this mac

03-07 ||  Readers: 7

More articles from:


Lockmymac.jpg There was always one feature from Gnome that i missed in Mac OS X, the ability to quickly lock your Mac with a shortcut and go for lunch. Sure, there's that option to lock your mac every time your screensaver goes on, but the problem with that is that I do not want to enter my password every time. At home for example, there is no need to lock my Macbook. Besides this function has a lot of issues when waking up from sleep; Sometimes I would have to wait for a minute until i get a login box. After a long hunt on macosxhints.com, I found a command to show the fast user switching login box without actually having to enable fast user switching:

/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend

There are several convenient ways to execute it:

  • Create an Automator action which executes a shell script (slow to execute)
  • Create an AppleScript Application and put it in your Dock:
    do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend"
  • Run the shell script/ AppleScript from Quicksilver
  • Run the AppleScript in Launchbar:
    Put the AppleScript (.scpt) from above in ~/Library/Scripts and enable Home Library scripts in the Launchbar Configuration (I found this to be the fastest option)
Finally, if you have no idea what I am talking about, but you need this functionality, check out Lock My Mac.
Like this article? Click “Recommend” to let others know your interest. Click "Tool Box"-> "Save" to add this article as your favourite.

Articles: