10

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
  • 221
  • 2
  • 3

3 Answers3

9

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
  • 397
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
  • 97,564
0

https://askubuntu.com/a/1268460/48214 was super helpful for me.

The Argo docs weren't as straightforward as I would hope, so I'll share my steps here to help you:

cd ~/code/ubuntu_tools
git clone https://github.com/p-e-w/argos
gnome-shell --version
# Based on the result above, you may need to switch branches like:
git switch -c gnome-44 GNOME-44
ls ~/.local/share/gnome-shell/extensions
ln -s ~/code/ubuntu_tools/argos/argos@pew.worldwidemann.com/ ~/.local/share/gnome-shell/extensions/argos@pew.worldwidemann.com
ls ~/.local/share/gnome-shell/extensions
mkdir ~/.config/argos/
code ~/.config/argos/timezones.left.1s.sh
# paste in code from https://askubuntu.com/a/1268460/48214
chmod +x ~/.config/argos/timezones.left.1s.sh
# Log out and back in
gnome-extensions-app
# check the box to enable Argos
# Log out and back in
# See new clocks in the top bar.
Ryan
  • 623