Hack Loginwindow

The hack_loginwindow.pl script is designed to automate customizing the loginwindow graphic. You could simply replace the graphic once, but hack_loginwindow.pl will use a different graphic based on the minor OS number (10.5, 10.5.1, etc) or you can use a custom graphic for a specific date (Halloween and April 1st are my favorites...).

The loginwindow has 2 images, an Apple and the "Mac OS X" text. This script replaces those graphics with custom graphics. To display the graphic in the whole loginwindow, the image placeholders in the NIB must be modified. These instructions show you how to modify the image wells and resize the top image to 290x470 the bottom image to 90x470.

The images that you create must be saved in TIFF format, without layers, WITH transparency.

You will need Interface Builder to modify the NIB. Interface Builder is part of the developer tools. The images below were made with Xcode 3.1. If you have a different version of Xcode, it may look slightly different.


Get the NIB

On 10.4 and 10.5 copy this file to your desktop:
/System/Library/CoreServices/SecurityAgentPlugins/loginwindow.bundle/Contents/Resources/English.lproj/LoginWindowUI.nib

Open the file LoginWindowUI.nib. Double click on "Window" if you don't have the window open.

You should see this.

At the top of the window there are 2 sets of blue squares with white question marks in the middle. You are going to change their size and position.


Resize bottom image

First, click on the second question mark, the one right above "<host information>". You should see several blue dots appear. They mark the size of the image.

Open the Inspector tool by pressing Shift-Command-i, or select the menu "Tools" -> "Inspector". The inspector will show you detailed infomation about the currently selected item, which should still be that image. It also has several panes of information. You want the size inspector (Command-3). You should see this:

Change the values from 28 337 414 24 to 0 0 470 70. Also change the autosizing so that it stretchs at the top instead of the bottom.

Make sure you have the image selected, and select the menu "Layout" -> "Send To Back". if you don't do this users will not be able to click on the "Password" field.

It should look like this.


Resize top image

Click on the top image.

Change the values from 190 372 90 90 to 0 198 470 290.

Make sure you have the image selected, and select the menu "Layout" -> "Send To Back". if you don't do this users will not be able to click on the "Password" field.

It should look like this.


Add a label with "xxxxxxxx"

Open the Library pallette

Drag the label to the window.

Change the text to "xxxxxxxx".

The purpose of this is that hack_loginwindow.pl will replace this text with the first parameter passed into it. Normally hack_loginwindow.pl is called by SED_find_errors.pl, so it will give the text to use.

Set the text size to 9 or 10 with the Fonts window.

Set the label size and position to 34 6 49 13 (you can't really change the last one, it is set by the Font size).