0

I like to have the date and time in ISO format (2017-10-30 19:57) on the top right of the screen. I also like to be able to configure things from the command line (an issue not addressed in the suggested "duplicate"), so that when I reinstall the OS I can just run a script and get my preferred configuration back.

After some painful digging around (and, I'm sure, some helpful askubuntu posts) way back then, I managed to get what I wanted. The following worked for several releases, up to and including 16.04 LTS:

gsettings set com.canonical.indicator.datetime time-format "'custom'"
gsettings set com.canonical.indicator.datetime custom-time-format "'%a %F %R'"

But it no longer works in Ubuntu 17.10 (I haven't tried Ubuntu 17.04). Can anyone figure out the equivalent settings for Ubuntu 17.10?

I launched dconf-editor and a search for "time-format" did not yield any results.

Here on askubuntu there seem to be several posts on changing date/time format but I could not find one relevant to Ubuntu 17.10.

st01
  • 1,083
  • 1
    Try Clock override as suggested in the proposed duplicate. In your case the format should be "%Y-%m-%d %H:%M". – pomsky Oct 30 '17 at 20:24
  • Just trying out these suggestions, thanks. First time I use "Gnome Extensions". Question 1 (in the spirit of my question above): how can I install them from a command line script, rather than via that rigmarole with browser plugin? Question 2: once I installed the Clock Override extension, how do I access its control panel in which I am supposed to be able to enter the format string you supplied? (Not by clicking on it...) – st01 Oct 30 '17 at 21:03
  • 2
  • I'm not aware of any easy cli way of installing. Installing extensions is simply extracting proper archive into ~/.local/share/gnome-shell/extensions/ and then you can activate/deactivate or customise them using GNOME Tweaks or from https://extensions.gnome.org/local/ (with the browser add-on). Also you may try to git clone if you know the source. 2. Once installed you may launch dconf-editor and navigate to /org/gnome/shell/extensions/. You'll see the extensions and their configurations and be able to change them. So gsettings should work accordingly.
  • – pomsky Oct 30 '17 at 22:21
  • 2
    For 2. I meant the easiest ways to access settings of an extension is from GNOME Tweaks or https://extensions.gnome.org/local (with the browser add-on). For cli way try dconf-editor/gsettings as suggested above. – pomsky Oct 30 '17 at 22:35
  • Thanks for these. 1. Installing these extensions via the command line sounds like a pain. Copying the files to that directory is not a big deal so long as the browser-based installation process doesn't also edit other magic metadata files. To activate them I guess I could write something like ['Move_Clock@rmy.pobox.com', 'clock-override@gnomeshell.kryogenix.org'] /org/gnome/shell/enabled-extensions using gsettings. For 2, yes, I saw a control panel for clock override in the "instructions" but no hints on how to get at it, so the answer I needed was "run gnome-tweak-tool". Thanks again. – st01 Oct 30 '17 at 22:47