Slashtime goes gooey

A long time ago I wrote a tiny perl script that told you the time in various places. It was a somewhat unusual take on the usual approach to the timezone problem in that it displays offsets from where you are, not offsets from UTC (which, unless you’re in the UK in the winter time, are really kinda useless). A number of people liked using it, which was nice. It was called “slashtime” since /time is a shortcut on my company’s website to get to an HTML version of it. Slashtime places list

For a while, though, I’d wanted to make a version that would be graphical; in addition to being more compact, I wanted it to be live and to help me with arranging meetings. So I did!

Here’s a screenshot of Slashtime running.

The new Slashtime inherited the original’s premise of showing offsets, of course, and adds some other nicities. When the sun is up is irrelevant in this day and age; but business hours aren’t (white background), as is knowing when it’s not a good time to call someone (the dark shading).

Knowing where you are is important too; that’s the blue line. There are a number of heuristics to try and figure that out, but if your Linux box’s /etc/localtime is a symlink to a file in /usr/share/zoneinfo like it’s supposed to be, you’re golden; it degrades gracefully from there, looking at what /etc/timezone says, then the TZ environment variable, etc, and doing all this in a hopefully OS aware way (there’s code in there that made it work Solaris, for example).

Oh, and yes, 01:30 is the fold point, quite deliberately. Hackers don’t go to bed at midnight. Perish the thought. So if the person you’re looking for is in the dark portion but at the bottom of the display, there’s every chance they’re still up :).

The list of places shown is specified in from a simple text file at ~/.tzlist (a default list will come up if you don’t have one). Instructions of how to set this file up properly to your own preferences is shipped with the program in the PLACES file. As you can see, I have quite a number of places in my .tzlist file, but there’s nothing wrong with just having two or three if those are the only places you want to know about.

The discussion in the PLACES example makes a point that might night be obvious at first glance: you control the names of the places shown. So if you live in Marseilles, and are tired of every other gizmo out there showing the time in “Paris”, you just go right ahead and put “Marseille” in your .tzlist file as:

"Europe/Paris"    "Marseille"    "France"

There’s also a meeting planner. Right-click the list and select “Meeting…” from the context menu:

Slashtime right-click context menu

and you can set the program to display a specific time and date somewhere in the world. More typically, you ned to hunt for a good time to have a phone meeting with someone; just move the sliders back and forth until you find a nice alignment for you and the other people on the call.

ime of Christmas 2007 in Toronto and Sydney Meeting planner Dialog

This example shows me working out that assuming I’m in Sydney that week, if I want to call my Mum to wish her a Happy Christmas, so long as I call just before I go to bed on 25 December it won’t be too early there (the red border is a warning that you’re not seeing current time displayed).

The GUI version of Slashtime has actually been around a long while; It’s written in Java and served as an early test bed for the java-gnome bindings of GTK and GNOME. Thanks to recent work by Serkan Kaba, however, the program is now properly internationalized. Not that there’s much to translate, but it’s important to at least set the foundation. Serkan did Turkish; I’ve done French Canadian (ahem, that’ll just go to show how rusty my Quebecois is). I must admit that I’m still pretty new to internationalization and localization, so I’m sure there’s room for improvement here.

Slashtime 0.5.9 was released this week with that branch merged. It’s packaged on Gentoo Linux as app-misc/slashtime. Building it yourself shouldn’t be hard; Thanks to people like Carl Worth and Rob Taylor it works out of the box on a number of other distros. You’ll need java-gnome >= 4.0.9. Just follow the instructions in the README file; once you’ve make installed it to the right place it’ll be in your system menus and whatnot. I personally also have a keybinding set up so I can easily run it on demand, but:

$ slashtime

will certainly do the trick :)

If you want to hack on Slashtime, just use Bazaar to grab the sources. The 'mainline' branch is at bzr:// and you can find me in #java-gnome if you want to chat about it.

Incidentally, no, this isn’t a GNOME clock applet replacement — although I’m very pleased that Bryan Clark picked up on some of the UI ideas when I showed Slashtime to him last year in Boston; sharing ideas and learning from each other is what Software Freedom is all about — but it is a fantastically useful program to have around when you’re dealing with people around the world, as so many of us do. Enjoy!