5

In Ubuntu 18.04, my current desktop looks like this:

screenshot

How do I display date under time in GNOME panel as below?

screenshot

8
  • the second image you got it from other pc or your pc? – UnKNOWn Oct 8 '18 at 4:39
  • just edited.. but found a solution now to achieve that – Sathish Kanna Oct 8 '18 at 5:13
  • Oh, thats nice. You can write your own Answer and accept it. – UnKNOWn Oct 8 '18 at 5:14
  • 1
    in clock override extension added this " %I:%m %p%n %d-%m-%Y" – Sathish Kanna Oct 8 '18 at 5:15
  • i tried your code. its nice. but alignment issues are there. its not perfectly in the center to each line. – UnKNOWn Oct 8 '18 at 5:18
7

Use clock override extension to achieve this.

After opening the extension's preferences, under "text to display instead of the clock" tab enter %I:%M %p%n %d/%m/%Y.

%n is responsible for next line and for the rest of formats check here.

screenshot

1
  • Nice catch! Thought this was not possible. – vanadium Oct 8 '18 at 7:27
3

this answer is only for "text alignment" purpose in continuation with the comments below the question and the already accepted answer.

when we enter next line by %n in the below field, the lines are aligned to the left as shown in the below image.

enter image description here

to make this alignment to the center, we need to open the gdm3.css file and edit the portion like below.

open the file by sudo -H gedit /etc/alternatives/gdm3.css find the below section under "TOP BAR" line number around 743.

#panel.solid .panel-button:checked {
        color: white; }
    #panel.solid .system-status-icon,
    #panel.solid .app-menu-icon > StIcon,
    #panel.solid .popup-menu-arrow {
      icon-shadow: none; }

and add the below lines under the line icon-shadow: none; }

#panel .clock-display {
   text-align: center;
}

it looks like below after adding the required lines.

#panel.solid .panel-button:checked {
        color: white; }
    #panel.solid .system-status-icon,
    #panel.solid .app-menu-icon > StIcon,
    #panel.solid .popup-menu-arrow {
      icon-shadow: none; }
#panel .clock-display {
   text-align: center;
}

Save the file & Close.
Reboot to see the change.

enter image description here

enter image description here

Note: if you use different shell themes than the default shell theme, you may search for the text clock-display in the respected gnome-shell.css file. if found, edit there, if not found add the lines as shown above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.