
With the release of OS X 10.5, we gained hundreds of new features. We also lost some, including the option to have a floating desktop clock (via the Date & Time System Preferences panel). Now the only time display option is in the menu bar. If you'd like to get it back -- and you have a copy of OS X 10.4 -- it's actually quite easy to do.
On your 10.4 machine, navigate to this directory (you'll have to control-click Menu Extras and choose Show Package Contents from the pop-up menu if you're not pasting this into the Finder's Go » Go to Folder dialog):
/System/Library/CoreServices/Menu Extras/Clock.menu/Contents/Resources/
In that folder, you'll find WindowClock.app. Copy it to your 10.5 machine, and drop it in your Applications folder. Launch it, and you'll find it works -- and you can even control-click on it to switch between digital and analog mode (your changes here will also affect your menu bar clock). You might think you're done, but there's a bit more work yet to do. First, the ownership on WindowClock.app wasn't quite right on my machine, so I changed it to match the other apps in Applications with this Terminal command, within the Applications directory (you could also leave it as owned by your user without any downsides, I believe):
sudo chown root:admin WindowClock.app
Next, the biggest problem with WindowClock is that it's a faceless background application -- so once you've launched it, you need to use Activity Monitor or Terminal to quit it. There are two ways around this problem: you can turn it into a regular application, or you can control it via an AppleScript. Read on for both solutions, as well as a way to tweak the floating clock's transparency.Solution one: Convert WindowClock into a regular app
There are many ways to do the following; I'm showing but one. Quit WindowClock if it's running, then in Terminal, type these commands:
$ cd /Applications/WindowClock.app/Contents
$ sudo vi Info.plist
Down near the bottom of this file, you'll see these lines:
<key>NSUIElement</key>
<string>1</string>
Change the 1 into a 0, then save the file. In my case, I had to use w! in vi, to overwrite a protected file. Quit the editor. When you launch WindowClock the next time, you'll see it has a normal dock icon, and there's even a very basic menu that will let you quit the app. The downside of this solution is that your clock is now occupying a spot in the dock, and can be Command-Tabbed to, etc.
Solution two: Make it simpler to quit WindowClock
This is the solution I used, based on this hint, which used an AppleScript to launch and quit the floating clock in 10.3. I couldn't get that exact version to work quite properly in 10.5, but the following script did the trick:
tell application "System Events"
if (get name of processes contains "WindowClock") then
tell application "WindowClock" to quit
else
tell application "WindowClock" to activate
end if
end tell
Copy the above code and paste it into an AppleScript, then save it as an application. When you want the clock on or off, just run your app, and it will toggle the state of the clock.
For an even slicker solution, get Butler (or any other tool capable of assigning AppleScripts to keyboard shortcuts). Copy the AppleScript into a new AppleScript Smart Item in Butler, and assign it a keystroke -- I used Shift-Control-T on my MacBook Pro. The floating clock is now a quick keyboard shortcut away from appearing (or disappearing) when I need (or don't need) its assistance.
Controlling transparency
The transparency of the floating clock is actually controlled (even in 10.5) in the menu bar clock's plist file. To change it, make sure WindowClock isn't running, then type this command in Terminal:
defaults write com.apple.MenuBarClock Transparency -float nn
Replace nn with a number between 0 (completely transparent) and 1 (completely opaque). Relaunch WindowClock, and it will reflect your new settings. The standard setting is 0.8, in case you ever want to restore it to the default. Note that this also works in 10.4.

