<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Art Of Geek &#187; fast user switching</title>
	<atom:link href="http://artofgeek.com/tag/fast-user-switching/feed/" rel="self" type="application/rss+xml" />
	<link>http://artofgeek.com</link>
	<description>Technology from the geek perspective.</description>
	<lastBuildDate>Thu, 18 Mar 2010 18:48:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Lock your Mac&#8217;s screen like in Windows [Update 1]</title>
		<link>http://artofgeek.com/2009/06/23/lock-your-macs-screen-like-in-windows/</link>
		<comments>http://artofgeek.com/2009/06/23/lock-your-macs-screen-like-in-windows/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:14:26 +0000</pubDate>
		<dc:creator>madgunde</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[fast user switching]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[lock screen]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://artofgeek.com/?p=421</guid>
		<description><![CDATA[<p>[Update 1] Anyone who uses Windows at work is probably familiar with the old Ctrl-Alt-Del &#60;return&#62; trick to quickly lock your screen when you step away from your computer. This displays a &#8220;This computer is in use and has been locked.&#8221; message which instructs you to press Ctrl-Alt-Del again to unlock the computer. Doing so [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-423" title="LockSystem" src="http://artofgeek.com/wp-content/uploads/2009/06/LockSystem.png" alt="LockSystem" width="128" height="128" /><a href="http://artofgeek.com/2009/06/23/lock-your-macs-screen-like-in-windows/#update_1">[Update 1]</a> Anyone who uses Windows at work is probably familiar with the old Ctrl-Alt-Del &lt;return&gt; trick to quickly lock your screen when you step away from your computer. This displays a &#8220;This computer is in use and has been locked.&#8221; message which instructs you to press Ctrl-Alt-Del again to unlock the computer. Doing so presents you with a username/password prompt, which looks very much like the login screen.</p>
<p>In Mac OS X, the closest thing we have is the &#8220;Require password to wake this computer from sleep or screen saver&#8221; check box in the Security system preference pane (in Mac OS X 10.5 Leopard). Then what a lot of people do is set a screen corner to activate the screen saver (via the Exposé system preference pane). Then just before they walk away, they move the mouse into the designated corner, wait for the screensaver to kick in, then walk away.<span id="more-421"></span></p>
<p>If you have OS X&#8217;s Fast User Switching enabled (via the Accounts system preference pane), there&#8217;s a second way to lock your screen which is a bit more like the Windows method. By selecting the &#8220;Login Window…&#8221; option from the Fast User Switching (FUS) menu in the top-right corner of your screen, you are taken back to the login screen while your user session continues to run in the background.</p>
<p>While the Mac OS X solutions works fine, some of us regular Windows users just prefer a more direct method of locking the screen similar to what is offered in Windows. I was one of those people. I liked the Fast User Switching method for locking my screen, but didn&#8217;t want to have to enable FUS to get it because I&#8217;m the only person who uses my Mac, and I didn&#8217;t want to give up the extra menu bar real estate to the FUS menu. In addition, the FUS method requires two clicks, which is one too many clicks! Ideally I wanted a single click solution or one which can be quickly activated with a hotkey.</p>
<p>In my searching, I found a Terminal command on <a title="Mac OS X Hints" href="http://www.macosxhints.com/" target="_blank">MacOSXHints</a> (it&#8217;s been posted so many times in different hints and comments too numerous to give credit to individually) which activates the &#8220;Login Window…&#8221; function from the FUS menu, even if FUS isn&#8217;t enabled! The command is as follows:</p>
<pre>/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend</pre>
<p>&#8220;Now we&#8217;re getting somewhere&#8221;, I thought to myself upon finding that little gem. If I could turn that into a double-clickable script or application, I could add it to the Dock and could lock my system with a single click of the mouse. Even better, using keyboard automation software <a href="http://www.shadowlab.org/softwares/spark.php">like Spark</a> or similar, you could even map a keyboard shortcut that would launch the script or app with the press of a couple of keys.</p>
<p>So to cut an already long story short, I figured out how to create a shell script and using XCode bundled it as an application. I won&#8217;t go into details on exactly how I did either, mainly because I did it a long time ago, and frankly can&#8217;t exactly remember, and that wasn&#8217;t the point of this post. Not being an artist, I borrowed Apple&#8217;s icon from Mac OS X&#8217;s Security Preference pane (thanks Apple!) and made it the icon for my new application bundle which I called simply &#8220;Lock System&#8221;. You can download the Lock System application from the link at the end of this article.</p>
<p>Once you&#8217;ve downloaded and extracted the zip file. Just move the Lock System application to your Applications folder (or anywhere else you want to keep it). I keep mine in ~/Library/Scripts so I can access it via the AppleScript menu. Then add it to your Dock or put an Alias on your Desktop for quick access. Finally, create a keyboard shortcut in <a href="http://www.shadowlab.org/softwares/spark.php">Spark</a> (or similar) for launching Lock System (I like Command+Shift+L), and that&#8217;s it! You can now lock your Mac like you do on Windows. Enjoy!</p>
<h6><em>Lock System should be compatible with Mac OS X 10.3, 10.4 and 10.5. <del datetime="2009-09-09T01:35:52+00:00">Anyone out there who can confirm if it still works in Mac OS X 10.6 Snow Leopard, please post your results in the comments, thanks!</del><em> [Edit: See <a href="http://artofgeek.com/2009/06/23/lock-your-macs-screen-like-in-windows/#update_1">my update</a> at the end of the article. - madgunde]</em> This software is presented as is and with no guarantees. You use it at your own risk, so don&#8217;t be coming back to me to complain that it&#8217;s hosed your system (which would be hard to believe anyway). I&#8217;ve been using it for years now and am only sharing because I thought others might appreciate it.</em></h6>
<p><img class="size-full wp-image-423 alignnone" title="LockSystem" src="http://artofgeek.com/wp-content/uploads/2009/06/LockSystem.png" alt="LockSystem" width="128" height="128" /></p>
<p><a href="http://artofgeek.com/wp-content/uploads/2009/06/Lock-System.zip">Download Lock System (12KB .zip)</a></p>
<hr />
<a name="update_1" ></a><strong><em>Update 1 &#8211; 9/8/2009, 9:30 pm:</em></strong> If you&#8217;re running Mac OS X 10.6 Snow Leopard, there&#8217;s an <a href="http://artofgeek.com/2009/09/08/lock-your-macs-screen-like-in-windows-snow-leopard-edition/">even more elegant solution</a> that doesn&#8217;t require any third party software to accomplish the same task. If you&#8217;re not running Snow Leopard, you better have a darn good reason, like your Mac doesn&#8217;t have an Intel processor or something. <img src='http://artofgeek.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://artofgeek.com/2009/06/23/lock-your-macs-screen-like-in-windows/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
