When we’re deploying Mac OS X there are a number of things that invariably end up being discussed. One of these is customizing the login window, where you type in your username and password. This might be swapping out the background of the screen, adding text or even changing out the Apple logo. To change out the background of the loginwindow, you can specify a new location. By default the location is stored in /System/Library/CoreServices as DefaultDesktop.jpg. You could replace this image or the preferred method would more than likely be to choose your image and then alter the /Library/Preferences/com.apple.loginwindow.plist, editing the key for DesktopPicture. For example, we can use…
-
-
Login & Logout Hooks
If you want to have a script run when a user logs in and/or logs out then you’ll likely want to look into using login and logout hooks. A hook is a script that runs as root (although you can execute as the user with su). Hooks are enabled in the /var/root/Library/Preferences/com.apple.loginwindow. You can do so using defaults, writing the path to the script into LoginHook as a string as follows: defaults write com.apple.loginwindow LoginHook /scripts/script.sh If you only want to run the script once (ie – at first login) then you can end the script with a defaults command that will then reset the field. defaults write com.apple.loginwindow LogoutHook…
-
logname and whomai
You can determine the name of a user who is logged in using a number of different methods. From the command line there are two commands that most commonly get used for this: logname and whoami. Each can be used without any arguments to return the name of the user running the command, a great way to debug scripts, or grab the name of a user. To use logname: logname To use whoami: whoami