Them Per User Idea - need help


I know very little UNIX but I was thinking...

Many hard working hackers have determined what resources can be altered to change colors, icons, and behaviors. Most of the changes need to be done by root because the mods are global.

Having a different theme per user would be nice.

I know you can create a UNIX soft link to a resource extending outside the package. Aliases do not work. In other words:

a) Copy desired resource file to a user directory
b) Make desired changes to copy
c) Rename original file to anything
c) Create a link with the original name in the package to the new modified copy.

Is it then possible to have this link change per user? Can the link use the global variable called USER? Can login/out scripts be used to modify that link? The login script would recreate the link. The logout script would alter the link to the original resource file.

If anybody knows UNIX enough to see how this could or could not work - let me know.
Man, I would never even have thought of that! It ought to work brilliantly!

the window manager is running as the individual user, not as root, otherwise you wouldn't be able to just log in and out again to see theme changes - you would have to reboot. Just looking at the output for "ps -x" in the terminal shows that you yourself are running the window manager, the dock, and the desktop (aka finder). That means all those finder buttons (or at least the pictures in them) the dock graphics, and the window extras could all be replaced with user-specific softlinks!

the directory called ~ is a shorthand for the user's home directory.
Unfortunately, .login and .logout are <i>not</i> run when you log in to the machine directly ( ie. sitting in front of it ). They are run when you open a terminal window only.

However, if you replace, say, /System/Library/Frameworks/HIToolbox.framework/Resources/Extras.rsrc (that's the file that controls all the window widgets, buttons, scrollbars, the menu bar, maybe a few other things ) with a soft link to ~/Library/Appearance/Resources/Extras.rsrc, that ought to do it.

Then when jove logs in, Window Manager would start up, and look in /Users/jove/Library/Appearance/Resources. The only problem would be that every user would have to have a ~/Appearance/Resources/Extras.rsrc file, which would not be created automatically when you added a user.

There may be some script in there somewhere that does get run when you log in at the computer itself, I just don't know where it would be
I tried "ln -s" using the '~' character in the destination file path. Unfortunately the '~' was only resolved when the link was created. Or maybe I didn't use the appropriate syntax to make the '~' part of the saved link specification.

To do things safely we really need a script(s). The script will be able to "recover" from a bad links and reset the system between sessions.

Specifying the the script in the startup items is probably too late to effectively change the resource links.

There has to be a hook somewhere. Is there a trick we could use with package versioning?
Look at the man page for "loginwindow" (the app that logs you in after you type your name into it, and stays active until you log out.)
Though dated 1989, the page makes reference to Mac OS X, so the information may be valuable. Anyway, it notes that there are application hooks for login and logout -- the caveat is that they are accessible only when you run loginwindow from the command line.
The solution? Find where (if anywhere) a startup file executes this application.
Some speculation regarding this has been posted (by myself and scruffy) here. Hopefully this is helpful, or you can contribute to it. There are a lot of cool things one could do if one could tinker with how OS X starts up.

Originally posted by scruffy
The only problem would be that every user would have to have a ~/Appearance/Resources/Extras.rsrc file, which would not be created automatically when you added a user.

I believe that is you were to create this in /usr/template/user then every new user you create will have it in their home directory. (This is equivalent to /etc/skel on other UNIX systems). This directory would also be useful if you wanted every new user to have a custom dock, etc. (just edit /usr/template/user/Library/Preferences/ or copy a working to there).

As far as links go, I can't offer anything useful.