Customize the login screen in Lion

A lot of people have complained that the login screen is too bland and boring in Lion - it now sports Apple’s new favourite grey linen texture. Fortunately, it’s not to tricky to make some customisations. It is possible to change the background, add a custom welcome message and display system stats. Find out how below.

Changing the background

In Lion, the background used for the login screen is located at

/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/

The easiest way to get to this folder is to choose Go to Folder in the Go menu while in the Finder. Then just copy and paste in the above line and click Go. The image that is used for the background is NSTexturedFullScreenBackgroundColor.png. You can replace this with any other image, and as long as you give it exactly the same name, it will be used for the login screen background. Before you make any changes, make sure you make a copy of the original file somewhere safe so you can go back to it if you want.

You’ll notice that the image is only a small 256x256 pixel square — this is because it is automatically tiled across the screen. If you want to use a similar type of texture, any size image is fine. However, if you would like to use a full size image without tiling, you need to make sure the image dimensions exactly match your screen and the resolution is 72 dpi. Either way, it must also be in PNG format like the original. It’s pretty simple to use Preview to adjust any image to the correct size and format.

Display a short message

Before Lion, displaying a message on the login screen was a complicated process that involved entering commands into the Terminal. Luckily, Apple have now added an easy way to set a message using System Preferences. To do this, go to the Security & Privacy preference pane, and under the General tab, tick the checkbox Show a message when the screen is locked then add your message. Only about the first 200 characters you enter will be displayed, so make your message short and sweet.

Login screen message in Lion

Display system stats

In older versions of Mac OS X, simply clicking on your computer name in the login window would cycle through displaying lots of useful system information. Unfortunately this feature has been removed in Lion, but you can bring it back to a certain extent. Open up Terminal (located in Applications/Utilities), paste in the following line and press Return:

sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName

Now when on the login screen, clicking on the time in the top right will cause the computer name to appear, followed by the OS version and build number, followed by the IP address.

Display a login banner

Apple has a great article over on their support site on how to display an agreement window where users must read and click Accept before logging into the computer. This is really useful for people who manage lots of Macs in a school or company with an “Acceptable Use Policy” that all users must agree to.

To do this, just create a file in TextEdit that contains whatever text you want to display. You can embed images and use whatever text styling you want. Once you are done, save the file with the name PolicyBanner in the Security folder in the Library in Macintosh HD.

Lion login screen PolicyBaner

Comments

Get iTunes track notifications in your Dock

In Lion there is a cool hidden setting to enable “Now playing” notifications that appear from the iTunes icon in the Dock. Every time a new song starts, a small popup containing the artist and the song name appears and then slowly fades out after a few seconds.

iTunes Dock Notifications

To enable this, start by opening Terminal (located in Applications/Utilities), then paste in the following line and press Return.

defaults write com.apple.dock itunes-notifications -bool YES

For the changes to take effect, the Dock has to be restarted. The easiest way to do this is to type killall Dock into the Terminal and press Return. If you change your mind and want to disable the notifications, repeat the above commands, but replace YES with NO.

For those of you who have your Dock set to hide when not in use, you’ll notice that when the Dock is hidden the iTunes icon is added to the notification. If you want the icon to show even when the Dock is not hidden, just use the following command in the same way as above:

defaults write com.apple.dock notification-always-show-image -bool YES

As before, remember to restart the Dock with killall Dock for changes to take effect.

It’s not entirely clear why this setting isn’t present in the iTunes preferences. It might still be under development — there is still room for improvement. For example it would be better if it included the album artwork like Bowtie, Growl and DockArt already do. It could also be a sneak peak of future plans Apple has for a notifications framework for all apps in Mac OS X, much like Growl provides at the moment.

Comments

Disable restored windows when re-opening specific apps

There’s a great tip over on the Macs in Chemistry blog on how to stop Lion from restoring your previous windows when re-opening specific apps. In System Preferences there’s a checkbox for turning this on and off globally, but using a handy little AppleScript you can disable it on a per-app basis.

One of the new features in Lion is the ability of applications to resume activity at the point an application was quit. This means that when you reopen an application it will open and display all the documents you were editing in the state when you quit the application. This is obviously very useful but there are times when you may not want confidential documents automatically opened and displayed when you open an application.

Here’s an example of the script for Safari:

set statePath to POSIX path of (path to home folder) & "Library/Saved Application State/com.apple.Safari.savedState"

set quotedPath to quoted form of statePath
try
   do shell script "test -w " & quotedPath
    set current to "enabled"
on error
   set current to "disabled"
end try

if current is "enabled" then
   tell application "Finder" to delete every item of ((POSIX file statePath) as alias)
    do shell script "chmod u-w " & quotedPath
    display dialog "Disabled window restore for Safari" buttons "OK" default button 1
else
   do shell script "chmod u+w " & quotedPath
    display dialog "Enabled window restore for Safari" buttons "OK" default button 1
end if

Head over to macinchem.org for a quick explanation of how to add it to your scripts menu to give you an easy place to access it.

Comments

Quickly add to do items to iCal's Reminders from anywhere with a keyboard shortcut

Until recently, my favourite task management (to do list) app for Mac and iPhone/iPad has been Things. It has just the right balance of Apple-like simplicity and powerful features that makes managing tasks quick and easy and not yet another task in itself. Unfortunately, the developers, Cultured Code, have been very slow at getting the cloud sync sorted out, meaning you still have to manually sync your tasks between your different devices and on top of this it’s still not even possible to sync tasks between multiple Macs.

With that in mind, I’ve been trying out some alternatives, including Wunderlist, but I’ve finally settled on using Apple’s own solution. With the release of iOS 5, Mac OS X Lion and iCloud, finally iCal Reminders on the Mac and the Reminders app on the iPhone are good enough to rival these third party solutions.

One piece of Things functionality I find myself missing, however, is the Quick Entry window. This allowed you to quickly create a new To Do item using a simple keyboard shortcut that worked in any application. This meant I could be reading an email, press the keyboard shortcut and Things would bring up a new To Do item dialog, autofilled with the details of the current email message.

Fortunately, we can go some way to replicating this functionality using an Automator service. Don’t worry if you’ve never used Automator before, this is a really easy workflow containing only a single “Automator action.” Start by opening Automator (located in the Applications folder), and choose the Service type for your new document.

Automator New Service

From the Calendar section of the Library, drag the New To Do Item action over into the workflow area on the right. This is the only action we’ll need! Using the fields and drop-down menus, you can customise the default values that will appear when the Quick Entry window is invoked. Before we save, there are two more things we need to set. Firstly, change the drop-down menus above the workflow to specify that the service receives no input in any application. Secondly, click the Options button at the bottom of the action, and check the box Show this action when the workflow runs. When you’re finished, it should look something like this:

Automator New To Do Item Action

To finish, choose Save from the File menu and give it a name like “New To Do Item.”

The next step is to add the keyboard shortcut so that we can easily bring up the Quick Entry window without having to go to the Services menu. To do this, open up System Preferences and go to the Keyboard section. Under the Keyboard Shortcuts tab, click Services in the list on the left, and scroll down to the bottom of the list on the right to find your new service. To add the keyboard shortcut, double-click on the area to the right of your service and press whatever shortcut you want. I went for Control-Option Space.

System Preferences Keyboard Shortcuts

Finally, all that’s left is for you to test it out. Open up Safari or Mail or any of your usual applications, and start going about your normal business. Then try pressing your chosen keyboard shortcut, and the Quick Entry window should appear. iCal doesn’t even have to be open.

Bonus Tip: If you’re feeling adventurous, try creating a second service that automatically takes the currently selected text as the title of the to do item by changing the Service receives drop-down menu to text. Check out the screenshot below for some ideas on how to do this.

Automator To Do Item Selected Text

Comments

Browse man pages in Lion's Terminal

Here’s a handy new feature tucked away in the Terminal in Lion. To quickly view the man page for any command, just right-click on it and choose Open man Page from the context menu. A new window will pop up, displaying the manual for that command.

Open man Page

This can save you a little bit of time, especially if you like to open up man pages in a new window alongside whatever you are currently working on. This way, you no longer need to open up a new window and type man <command> every time. It also displays the man pages with a distinctive yellow background, so its easier to distinguish if you have a lot of Terminal windows open.

As with a normal Terminal window, the colour scheme is also customisable. In the Terminal Preferences, just look under the Settings tab and choose the Man Page theme from the list.

Lion Terminal man Page

The Open man Page menu item is also available from within the yellow man page windows. I find this really useful when I get to the “See Also” sections that are common at the end of many man pages. Instead of having to remember all the related commands and look at their man pages one at a time, I can simply right-click on each and simultaneously open up man pages for all of them.

Finally, there’s another menu item, Search in man Pages. This uses the apropos command to display a list of all the available man pages for commands that contain the keyword you have clicked on. As you’d expect, you can just right-click on any of the search results and choose Open man Page to view the relevant page.

Comments