Lock Your Screen on Mac

The Windows shortcut for locking the screen is pretty convenient (Windows Key + L). When you’re at work or a more public setting it’s nice to be able to lock your screen quickly before leaving your computer temporarily. In my searches to find a convenient way on Mac, I found a number of ways, many of which involve extra applications and menus in the menubar. I’ll briefly mention a few ways that may interest you, then mention the method I settled on.

One way is to add the Keychain Access menu to your menubar. To do this, Open Keychain Access (Cmd + Spacebar >> type Keych >> Enter) then open preferences (Cmd + ,) and check the first option to “Show keychain status in menubar.” Now you can lock the screen from the Keychain Access menu.

Keychain Access Menu

Another way is to enable the Fast User Switching menu. Do this by accessing System Preferences >> Users & Groups >> Login Options and then checking the option to “Show fast user switching menu as…” This will add a menu next to Spotlight and the clock allowing you to show the login window.

Fast User Switching Menu

While both of these methods are effective, they involve extra clutter in your menubar. So I’ve discovered two other easy ways that involve shortcuts. The first method uses the Screensaver Shortcut. To make this work, you’ll have to change your security settings such that your computer requires a password immediately after the screensaver starts. This can be done by navigating to System Preferences >> Security & Privacy. Check the first box and set the menu to “immediately”. Now all you have to do is key Ctrl + Shift + Eject. If you’ve done it correctly, you should be asked for a password as soon as you exit the screensaver via moving the cursor or pressing a key.

I prefer to have my screensaver come on relatively quickly (10-15 minutes) and I don’t like it when my computer asks me for a password immediately, so I went another route using Automator. It turns out you can control Fast User Switching from the command line using a binary called CGSession. CGSession takes two options (that I know of), namely -suspend and -switchToUserID <value>. Simply open Automator (Cmd + Spacebar >> type Autom >> Enter) and under the Utilities section find “Run a shell script” and drag it to the section on the right. Now copy and past the following script in the field where it says “cat” by default:

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

Automator Screenshot

Be sure to change the menu for “Service receives” to “no input”. Now save this simple one step workflow as a service and call it something like “Lock Screen”. Now we are going to assign this service a global hotkey/shortcut. Navigate to System Preferences >> Keyboard >> Keyboard Shortcuts >> Services. At the very bottom, you should see a general service called “Lock Screen”. Make sure the box is checked and when you hover over it you should see a little button that says “Add Shortcut”. Click that and add a shorcut like Cmd + Alt/Opt + L. Now you should be able to lock your screen globally at any time.

System Preferences Keyboard Shortcuts

Alternatively, you could try using Quicksilver–a simple app that allows you to create powerful global shortcuts and the like. I used this before creating a service through Automator; however, I found it a bit cumbersome to use and setup. You shouldn’t need an extra app for something so simple.

Which way do you like best?

Mini-App of the Day: BetterTouchTool

BetterTouchTool IconIf you don’t know what BetterTouchTool is, you should read this post. If you have a Mac, you should really read this post. If you have a PC, you should still read this post. It will be worth your time to see what you are missing out on either way. It will also answer why you’d ever want to buy a Magic Trackpad if you are a Mac user and you’re saying to yourself, “Isn’t a mouse better in all regards?” For those of you who know what BetterTouchTool is and currently use it…just glory in your preeminence. ;)

BetterTouchTool is a big reason why I have loved my switch to a Mac for the last 2 years. I’ve always been a PC user. I have nothing against PC’s in general. I had some bad luck with a Dell laptop once, but I’ve seen plenty of Macs crash and burn too (some of you are probably sitting there saying, “You should have bought an HP” or “…a Lenovo.”). Though, those Asus Ultrabooks are looking pretty slick if you want the PC version of a MacBook Air.

BetterTouchTool is a utility designed to give you more control of gestures on your trackpad.  Apple did us a huge favor by making trackpads a lot bigger and by integrating the button into the pad. Genious. Apple also did us a great favor by eliminating (and returning to their old standard I might add) the second button because now if you want those menus, you just tap with two fingers. Also genious. (I realize this is up for debate depending on preference and habit, but if you are going to just argue more is better, I won’t humor you. I will entertain that two buttons–one on the left, one on the right–is just as good.)

So what does this mean? Well, Apple included a few gestures in Leopard, then a few more in Snow Leopard, then a few more in Lion. Maybe they’ll finally have a sufficient amount in Mountain Lion, though I doubt it. BetterTouchTool (BTT) makes up the lack thereof. You can go ahead and turn off most of the default gestures Apple gives you and re-program them how you want. That’s what I did. BTT allows you to add almost as many gestures as you can think of and assign them any number of preconfigured actions or a shortcut key. So now, instead of having to move your cursor everywhere or even reach to your keyboard for a shortcut, you can just use your trackpad.

For example, if you want to open and close tabs in your Internet browser, or go back and forward in your navigation history, you can do that with a gesture. You don’t need to click the button with your cursor or press Ctrl/Cmd + T or Ctrl/Cmd + [. Just program those shortcuts into gestures. This goes for any program.

Since it’s kind of hard to demo this with screenshots because you would need to verify I’m not using the keyboard, I went ahead and made a simple screencast video.

The following video gives you a short idea of how to actually “program” these gestures.

One limitation to gestures is that you inevitably run out of easy to remember and easily executed gestures. There are a lot of different gestures available, but some of them are hard to execute so chances are you will just resort back to keyboard shortcuts or cursor clicking. That said, I would encourage you to not give up after the first couple attempts to use some of the gestures. Putting all five fingers on the track pad and clicking is a little awkward the first time (just like the first time you played Halo and had to get used to the strange joystick combination or the first time you drove stick shift or rode a bike). Naturally, your muscles will adapt and you will react on muscle memory as soon as your mind thinks “Finder” or “New Tab.”

For your convenience and demo-ing. I’ve included a download of my current BetterTouchTool configuration below. I admit there is a lot of room for expansion into other apps I don’t use regularly; however, the basic and most powerful functionality that I need is there and I use it everyday. I highly encourage you to check this out and spend some time customizing it to your needs. It will highly improve your Mac experience.

Download BetterTouchTool.
Download BTT Functionality Demo Video or view on YouTube.
Download BTT Preferences Demo Video or view on YouTube.
Download My BTT Configuration File (you’ll want to remove the .txt extension before importing).