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

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

3 Answers 3

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, 2018 at 7:27
4

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.

0

For anyone seeking an alternative solution, the Date Menu Formatter extension seems to offer the same formatting features with the added bonus of automatically handling centering the alignment.

https://extensions.gnome.org/extension/4655/date-menu-formatter/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .