Skip to main content
  1. Posts/

Clocks in multiple time zones with i3status

·209 words·1 min·

Many of my coworkers are on Central European Time (CET) and they’re seven hours ahead of me (most of the time). Then there are those weird times of year where they move their clocks for Daylight Savings Time before we do in the USA.

I have a handy clock in my i3status bar, but I’d like to track my coworkers’ timezones in addition to my own.

Configuration #

By default, i3status looks for its configuration file in ~/.config/i3status/config. Open up the configuration file in your favorite editor and add two pieces.

I’m most interested in CET, so I’ll use Berlin for my extra clock. First, add two tztime lines near the top:

order += "tztime berlin"
order += "tztime local"

Then add the corresponding sections at the end of the configuration file:

tztime local {
        format = "%Y-%m-%d %H:%M:%S πŸ‡ΊπŸ‡Έ"
}

tztime berlin {
        format = "%H:%M πŸ‡©πŸ‡ͺ"
        timezone = "Europe/Berlin"
        hide_if_equals_localtime = true
}

The hide_if_equals_localtime configuration ensures that I only see one clock if my local timezone switches to CET. Emoji flags add a little bit of flair to the clocks in the status bar. πŸ˜‰

Here’s how it looks (with the Hack font):

i3status screenshot

Apply the change #

Reload the i3 configuration with Mod+Shift+c and restart i3 with Mod+Shift+r.