1

I am using the World Clocks applet in Ubuntu 20.04 and would like to:

  • change the order of the clocks without erase/re-add
  • ideally set the clocks (order) from the command line

Is that possible?

Matifou
  • 766

2 Answers2

3

Yes, in theory.

You can get the currently selected locations with

gsettings get org.gnome.shell.world-clocks locations

If you have specified, e.g., UTC and Amsterdam, this will give you

[<(uint32 2, <('Coordinated Universal Time (UTC)', '@UTC', false, @a(dd) [], @a(dd) [])>)>, <(uint32 2, <('Amsterdam', 'EHAM', true, [(0.91280719879303418, 0.083194033496160544)], [(0.91367986341903151, 0.085812027374152042)])>)>]

You can change the order of the blocks starting with <(uint32 and write that string back to the dconf database using

gsettings set org.gnome.shell.world-clocks locations [string with modified clock order]

However, you will need to escape the parentheses and brackets in the new string to prevent the shell from interpreting them. I haven't managed to do do. Perhaps someone can chime in on how to fix the string.

Jos
  • 30,529
  • 8
  • 89
  • 96
1

If you preferred having a GUI to do this,

  1. install dconf editor
  2. Search for 'world-clocks' / Navigate to org.gnome.shell.world-clocks
  3. Re-order the clock values in the Custom Value section.