When I got my first Mac, a MacBook Air, I typically used it either on its own, or hooked up to a Thunderbolt display with an extended USB keyboard and a Magic Mouse. In either scenario I needed a way to quickly lock it when I walked away from it. The cumulative wisdom on the web indicated putting the machine to sleep was the easiest approach, with the system preferences set to require a password on waking. How to quickly get the Mac to sleep then?
One suggestion was to simply close the lid, but that doesn't work with a Thunderbolt display attached. Another was to use the keyboard shortcut
Ctrl-Shift-Eject, but the MacBook Air doesn't have an
Eject key, and the alternative
Ctrl-Shift-Power didn't exist or wasn't well known at the time. Another suggestion was to bind a five finger gesture to sleep, something that might be awkward with a Magic Mouse and would require a third-party app anyway. Another was to use an active corner, but that could cause problems when running Windows 8 in a virtual machine (an OS with a fixation on corners).
The simplest suggestion I could find, and the one I ultimately went with, was to use the screen saver instead of sleep. It too can require a password on exit and is relatively easy to bind to a terminal shortcut. Here's how.
vim ~/.bash_profilein the terminal.
alias ss="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine"to the bottom of the file (its Vim, so hit
Gto get to the bottom,
oto create a new line, type the line above, then hit
:wqto write the file and quit.
Now when I want to walk away from my Mac, regardless of the peripherals attached, I tab into terminal and type
Enter. Instant screen saver, followed by sleep ten minutes later. Exiting either mode requires a password, and that works for me.
There are 0 comments.
browse with Pivot
ASP.NET MVC (13)
Brisbane Flood (1)
Building Neno (38)
Concurrency Control (2)
Entity Framework (1)
Inversion of Control (5)
OS X (1)
SQL Server (5)
Visual Studio (2)
Windows Forms (3)
Windows Service (1)