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.

How can I make my Mac display the login screen (as though I'd selected "Login window" from the fast user switching menu) after the session has been idle for a certain time?

I can make it log out after some amount of inactivity, but I don't want that. I want my programs to continue running.

I can also set the screen saver to require a password, and clicking the "Switch user" button on the password dialog will display the login screen. I'd effectively like to skip that step and go directly to the login screen without having to push the button.

share|improve this question
    
What is wrong with the "Require password" on the screensaver ?? –  Rene Larsen Apr 3 '11 at 10:44
    
I did mention that possibility in the question, but I guess I can expand on why that's not ideal: When I forget to log out properly, the next person who wants to log in to the computer sees the screensaver password dialog instead of the login window. It's not what they're accustomed to seeing, and it gives a stronger indication that I'm still using the computer, which generally isn't true — I just forgot to go to the login window before I left, and I'd rather not let my forgetfulness make waves. –  Rob Kennedy Apr 3 '11 at 16:43

2 Answers 2

up vote 3 down vote accepted

One solution could then be this one...

Download this ScriptSaver (ScreenSaver): http://swannman.wordpress.com/projects/scriptsaver/ - which can run AppleScripts.

Then write an AppleScript script with this content:

tell application "Finder"
    do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend > /dev/null"
end tell

Setup a ScreenSaver in "Desktop & Screen Saver", and configure this with the ScriptSaver, which you then setup with the AppleScript script from above.

After min. 3 minutes the current user session will be switched to the Fast User Switching window.

share|improve this answer
    
So far, so good. Thanks. –  Rob Kennedy Apr 5 '11 at 15:15
    
Thank you for sharing ScriptSaver! I was looking for the same thing and this just does it! –  user6571 May 18 '11 at 16:17

Rob, you can use DssW Power Manager to automatically Fast User Switch to the Login Window after user inactivity. This will leave your account logged in and your applications running.

The following link shows you how to create the required event for automatically logging out; in step 4 change the action from Log Out to Fast User Switch to get the behaviour you are after:

How to Automatically Log Out After Inactivity on Mac OS X

DssW Power Manager - User event after inactivity

Power Manager also includes a task to "Secure sleep after inactivity". This task Fast User Switches to the Login Window and then puts the Mac to sleep.

Disclosure: I work for DssW.

share|improve this answer
    
Looks promising, but a little overkill for my needs right now. –  Rob Kennedy Apr 5 '11 at 15:16
    
@Rob Kennedy, no problem. There is always a free demonstration if you want to prove the concept is possible, before writing and testing your own script. –  Graham Miln Apr 6 '11 at 5:29

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.