Auto-timeout to the fast user switching window

Mar 08, '04 09:41:00AM

Contributed by: MrMikeMGM@mac

While this is far from an original hint on my part, it does pull together several good things into one bucket and provides an elegant solution to address multi-user system screen savers and security.

So what I wanted to do was to use the builtin fast user switching capabilities of Panther as a Screen Saver. By that I mean, when a predetermined, configurable period of time elapsed, I wanted the built in screen saver to activate fast user switching to simply display a new login window without logging the current user out. There are two parts to the solution:

A previous hint that I picked up on when it first came out pointed out how to activate Fast User Switching from the command line in a pretty elegant way and an additional comment there showed how to add that capability to a button on the side-bar for the Finder window. This is the basis of this hint. Get the shell script included there installed somewhere in your path (I selected my Fink file structure since it was outside the main distribution and was "safe" so I added the script as /sw/bin/SwitchUser).

Then go get ScriptSaver and install it. It allows you to run AppleScripts from the builtin Screen Saver function of MacOS. There is a script included with the distribution that is called "Log Out.scpt" intended to log out the current user when activated by manually killing the login window process. This is a little too harsh for my needs, so I modified the script replacing the kill command in there with a call to my /sw/bin/SwitchUser shell script from the first part of this hint.

When all is said and done, you now have the ability to set a configurable time of inactivity before the active user is switched back to a login window using the built-in functions of Panther fast user switching and screen savers. This affords the active user the ability to save his work and log out gracefully at a later date as well as automatically protecting his account integrity and the confidentiality of his data.

I'm sure there are a million other ways to do this, and this may well not be the best out there, but it certainly pulls together some nice functionality into a cool solution IMHO. If anyone has suggestions on improvements, let me know and if there's anything that's not clear, feel free to email for a more detailed description.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040226142507783