Cooking with Linux - It's About Time!

To answer the classic question, “Does anybody really know what time it is?”, our Chef's answer seems to be, “Yes, but you need lots and lots of clocks.”

Although binary clocks may be geeky, there's something cool about a nice, retro, analog clock running on your desktop. To avoid looking for and downloading anything, try the venerable Xclock that comes with your system's X software. This baby was originally written by Tony Della Fera, Dave Mankins and Ed Moy. To run the Xclock, simply type xclock (use your Alt-F2 program launcher or the command line). By default, it doesn't show a second hand. To activate that, type xclock -update 1. This adds a second hand that updates every second.

The Xclock hasn't changed much over the years (why mess with success?), but that lack of change got Marc Singer writing his Buici clock, a simple, yet classy clock that does nothing other than show you the time with a nice, red, sweep second hand. For those who like a little more animation than just a sweep second hand, I recommend Kaz Sasayama's rglclock. This is a rotating 3-D Mesa/OpenGL clock that you can drag with the mouse to spin in whatever direction and at whatever speed you like. All three of these are shown in Figure 4.

Figure 4. Analog clocks come in many styles, from the classic Xclock on the left, followed by the simple but classy Buici clock in the center, and the spin-happy rglclock to the right.

Taking classy to a higher plane was surely Mirco Mueller's plan when he wrote Cairo Clock. Seriously, this is a gorgeous-looking clock with several different faces, 12- and 24-hour formats and more. To change a running Cairo Clock, right-click and a menu appears letting you change not only the look of the clock, but several other attributes as well (Figure 5). You even can change the size to whatever you like.

Figure 5. The highly configurable and beautiful Cairo Clock can be changed while it is running.

Although I've spent some time talking about analog clocks, there are some pretty cool digital clocks out there as well. One of my favorites is Jamie Zawinski's XDaliClock (Figure 6), a wonderfully strange digital clock where the numbers don't so much change, as morph. Second by second, and minute by minute, digits melt from one to the other. You'll be watching this one just to see the hours change as 59 minutes and 59 seconds approaches. Use the command xdaliclock -cycle, and you'll not only see the numbers morph, but the background color as well.

Tim Edwards' dclock, a modification of Dan Heller's original code, is a great digital clock that looks like the old seven-segment LED display clocks. dclock has a number of command-line arguments that let you set the date format, the color of the LED segments (both on and off) and more. For instance, typing dclock -date Today is %A, %B %d -fg yellow -bg brown -led_off brown4 generates the clock in the lower part of Figure 6. Furthermore, while the clock is running and your mouse pointer is inside the active window, you can change various settings with single keystrokes. For example, pressing the S key toggles the seconds display, R reverses the video colors and / increases the angle of the digits. Check the documentation for other one-key changes.

Figure 6. The very cool XDaliClock melts away the seconds, while dclock keeps somewhat more solid time.

All this talk of clocks just makes it more apparent that closing time is fast approaching. While François refills your glasses a final time, I'll leave you with perhaps the strangest clock of all, the aptly named UFOClock by Matt Wronkiewi (Figure 7), which is also very cool and worthy of some desktop space.

Figure 7. The UFOClock—timepiece or artifact left behind by an alien race?

The UFOClock displays the time of day, the phase of the moon, ratio of day to night, time to the beginning (or end) of twilight, and the time until the solstice or equinox. If you are asking, yes, I'm still trying to figure it all out. The distribution bundle comes with an example configuration file, so you can set the latitude and longitude of your home location (so you can tell the time of day).


Free Dummies Books
Continuous Engineering


  • What continuous engineering is
  • How to continuously improve complex product designs
  • How to anticipate and respond to markets and clients
  • How to get the most out of your engineering resources

Get your free book now

Sponsored by IBM

Free Dummies Books
Service Virtualization

Learn to:

  • Define service virtualization
  • Select the most beneficial services to virtualize
  • Improve your traditional approach to testing
  • Deliver higher-quality software faster

Get your free book now

Sponsored by IBM