9

Example image:

enter image description here

Where multiple clocks from different time zones are displayed adjacent to the clock that is normally there in the top bar of Ubuntu 19.

Smyther
  • 211

2 Answers2

8

Expanding on vanadium's answer, here's an example file to put multiple clocks up on your top bar:

  1. Just install the argos GNOME extension from here: https://extensions.gnome.org/extension/1176/argos/

  2. create a new text file called timezones.left.1s.sh in the folder ~/.config/argos/
    NOTE: (the filename tells argos you want it as far left as possible, and refreshes the script every 1 second - otherwise the time will not refresh!)

  3. Edit that file and paste this sample in:

    #!/usr/bin/env bash
    echo -n "Denver - " ;
    TZ='America/Denver' date +%H:%M\ %Z | tr -d '\n' ;
    echo -n " • " ;
    echo -n "Texas - " ;
    TZ='America/Chicago' date +%H:%M\ %Z | tr -d '\n' ;

  4. Modify to your liking.

Here's what mine looks like:

C.Rogers
  • 387
  • 1
    Thanks! Works for me. It's somehow not aligned left, but that is not a big deal. – patapouf_ai Sep 09 '20 at 12:37
  • For ubuntu 2022.04, the webpage says incompatible, but you can still install with the manual description here https://github.com/p-e-w/argos#manually. Also, you need to make the file executable. Thanks everyone for sharing, helped me a lot. – jouge Nov 20 '23 at 18:15
4

Lacking a working dedicated Gnome Shell extension, you could create your own indicators using the Gnome Shell extension "Argos". Argos is a very well maintained Gnome Shell extension that allows you to turn any command/script output into an indicator on your panel. Thus, you could use it to create indicators that show the time of different time zones.

For example, you can retrieve data and time for a specific time zone with a command such as

TZ='America/Los_Angeles' date

Use the command tzselect to find the TZ variable for your zone of interest.

Check the very good documentation on the Argos website to learn how you can create an indicater showing you the output of that command on your panel.

vanadium
  • 88,010
  • +1 This got me on the right track. See my complete answer below for specific instructions. – C.Rogers Aug 19 '20 at 15:54
  • 1
    Note that the extension is broken for 20.04 (Shell 3.36) but comments on the Gnome Shell extensions indicate that there are ways to make the extension work on 20.04. – vanadium Aug 20 '20 at 08:05