Jump to content

Recommended Posts

Posted

<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2011/08/disable-reopen-windows.jpg" alt="Disable Reopen Windows when Logging In" title="disable-reopen-windows" width="531" height="255" class="aligncenter size-full wp-image-20610" /></p>

<p>You may have noticed that when you log out or reboot Mac OS X Lion, you get a dialog window with a checkbox next to “Reopen windows when logging back in” that restores all of your currently open applications and windows. </p>

<p>If you don’t like it and you’re tired of unchecking the box to no longer reopen the windows, you can use a third party script to render the feature useless. To clarify, what this does is disable the feature completely on a constant basis, regardless of whether that checkbox to preserve windows is checked or not, the windows will not restore.</p>

<p>While this is part of OS X Lion’s Resume feature, this is different than <a href="http://osxdaily.com/2011/07/18/disable-mac-os-x-lion-resume-window-restore/">disabling app Resume completely</a> or <a href="http://osxdaily.com/2011/08/01/turn-off-resume-per-app-in-mac-os-x-lion/">on a per application basis</a>, because this only effects reboots and logouts.</p>

<h2 style="font-size:1.2em;">Turning Off “Reopen windows when logging back in” by Making it Useless</h2>

<p>Remember, this script disables the feature, but the dialog window will still pop up. The difference is with this script, <em>it won’t matter if the dialog box is checked or not, windows and apps will not restore</em>.</p>

<p>Paste the following <em>into a single line</em> within the Terminal:</p>

<p><code style="font-size:8px;">curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh</code></p>

<p>(The above text is intentionally small so that it will fit on a single line)</p>

<p>That command downloads a script, places it in the appropriate location, makes it executable, and then removes the temporary file. If you are wondering, the contents of the downloaded bash script are the following:</p>

<p><code style="font-size:95%;">#!/bin/bash

echo "#!/bin/bash" > /tmp/loginfix.sh

echo "rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*" >> /tmp/loginfix.sh

mv /tmp/loginfix.sh /usr/bin/loginfix.sh

chmod +x /usr/bin/loginfix.sh

defaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh</code></p>

<p>If you ever want to revert back to the default behavior of this OS X Lion feature, just type the following defaults write command:</p>

<p><code>sudo defaults delete com.apple.loginwindow LoginHook</code></p>

<p>And you’ll be back to be able to select window restore based on that checkbox’s choice.</p>

<p>This little script <a href="http://hexbrain.wordpress.com/2011/08/24/getting-rid-of-lions-application-restore/">comes from HexBrain</a>, thanks for sending this in Mark!</p>

</div>

<p><a href="http://feedads.g.doubleclick.net/~a/I2Q87OMD7FVWGiB5bGCa5Fq8TSw/0/da"><img src="http://feedads.g.doubleclick.net/~a/I2Q87OMD7FVWGiB5bGCa5Fq8TSw/0/di" border="0" ismap="true"></img></a><br/>

<a href="http://feedads.g.doubleclick.net/~a/I2Q87OMD7FVWGiB5bGCa5Fq8TSw/1/da"><img src="http://feedads.g.doubleclick.net/~a/I2Q87OMD7FVWGiB5bGCa5Fq8TSw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">

<a href="http://feeds.feedburner.com/~ff/osxdaily?a=D8tJAW44ip4:8v-WuZrbRpw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=D8tJAW44ip4:8v-WuZrbRpw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=D8tJAW44ip4:8v-WuZrbRpw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=D8tJAW44ip4:8v-WuZrbRpw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=D8tJAW44ip4:8v-WuZrbRpw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=D8tJAW44ip4:8v-WuZrbRpw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=D8tJAW44ip4:8v-WuZrbRpw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a>

</div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/D8tJAW44ip4" height="1" width="1"/>

 

View the full article

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic


×
×
  • Create New...