Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I came across an article explaining how to load your desktop before you login.

  • Does anyone know if this works in Lion?
  • Is there any reason I should avoid attempting it?

Load your desktop before login

  1. Go to System Preferences → Users&Groups → Login Options to enable automatic login.
  2. Then, copy and paste the following code into TextEdit.app:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>AbandonProcessGroup</key>
        <true/>
        <key>Label</key>
        <string>com.luomat.loginhook</string>
        <key>ProgramArguments</key>
        <array>
                <string>/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession</string>
                <string>-suspend</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
</dict>
</plist>

3. Go to Format → Make Plain Text and save the file as

    com.luomat.loginhook-2.plist

and put it in

    ~/Library/LaunchAgents
  1. After rebooting your computer, you'll notice the login screen shows up, but when you log in, your desktop and all your startup apps will be loaded and ready to go.
share|improve this question
2  
What this is doing is the equivalent of choosing "Login Window..." from the fast user switching menu as soon as you log in. I'd test it out by creating a test user and doing it there. –  Jay Thompson Mar 12 '12 at 14:21
add comment

2 Answers 2

As @eyemyth said above, the script above is the equivalent of choosing "Login Window..." from menu bar when you have user switching enabled.

The only security 'issue' I can see with doing this is that momentarily your desktop will be shown until the computer calls the script - depending on how many scripts you have or how busy your login is that may not be instantly.

Also, someone (correct me if I'm wrong) could boot into single user mode, delete the plist file and then reboot - though this is an extreme.

share|improve this answer
2  
If somebody has physical access to your Mac and can boot into single user mode, there's not much they can't do. You can set up an admin account and gain root access within a few minutes if you know what you're doing. –  Jay Thompson Mar 12 '12 at 23:51
    
@eyemyth It goes without saying: physical security is just as important as virtual security –  OrangeBox Mar 13 '12 at 0:03
add comment

I tried implementing this in OSX mavericks. While it "mostly" worked, it created some issues over time. Sometimes I would have to login 2 or 3 times to get back to the desktop. I found another article that presents a perhaps cleaner method that uses the same idea (via AppleScript). Basically, I created an App, that does the "suspend" via a compiled AppleScript. I then merely added the compiled App to the end of login items (Users and Groups under System Preferences). This alternate method worked like a charm.

--LoginWindow
--This Script shows the Login Window without Logging you out.
--Nice to lock your Mac without having to close the lid.
do shell script ¬
    "/System/Library/CoreServices/Menu\\ Extras/" & ¬
    "User.menu/Contents/Resources/CGSession -suspend"

https://github.com/frostrubin/Mac-OS-X-MiniApps/blob/master/LoginWindow.applescript

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.