Modification of the Cinnamon panel clock

Style your desktop
Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
mentospl
Level 1
Level 1
Posts: 11
Joined: Tue Nov 10, 2015 9:45 am

Modification of the Cinnamon panel clock

Post by mentospl »

Hi

Is it possible to somehow modify the clock to show the time and date in two lines (similar to KDE)?

screen.png
screen.png (3.51 KiB) Viewed 224 times
michael-hi
Level 4
Level 4
Posts: 234
Joined: Sun Mar 19, 2017 2:31 pm

Re: Modification of the Cinnamon panel clock

Post by michael-hi »

Hi mentospl

You could try this. Right-click on the clock and choose 'Configure', then click to switch on the option 'Use a custom date format', then copy/paste the following into the Date Format box to replace what's already there:

Code: Select all

%l:%M %p %n%x
Replace the l (small L) with an I (capital I for India) if you want the time to show a leading zero - 02:45 PM instead of 2:45 PM. You can leave a space between %p and %n or not leave one, whichever looks best. However, I'm not sure there's any way to adjust the font size, eg to make the date smaller than the time.
mentospl
Level 1
Level 1
Posts: 11
Joined: Tue Nov 10, 2015 9:45 am

Re: Modification of the Cinnamon panel clock

Post by mentospl »

Thanks a lot!
I didn't know about the %n option.
Unfortunately with my panel height (I like a narrow traditional panel) the current fonts don't look good...
I may have to edit cinnamon.css but this is above me :(
michael-hi
Level 4
Level 4
Posts: 234
Joined: Sun Mar 19, 2017 2:31 pm

Re: Modification of the Cinnamon panel clock

Post by michael-hi »

If it's just a question of the font size, it seems (from a brief search online) that this can be changed if you go to /usr/share/themes and find the relevant cinnamon.css file for the Desktop theme in use. Edit that file as root. Find the line
.applet-label {
and add a line underneath it:

Code: Select all

font-size: 8pt;
Adjust the font size to suit. Alternatively, you can use em rather than points so the new size will simply be a proportion of the existing font size, eg:

Code: Select all

font-size: 0.8em;
I don't use Cinnamon but I tried it on a Cinnamon Live USB and it worked. You shouldn't need to reboot but you may need to switch to another desktop theme and then back again for the effect to show up.

You can also do this by copying the whole theme folder into a hidden folder .themes in your home folder (make sure your file manager is set to show hidden files and create the .themes folder if it does not already exist). Then edit the file as ordinary user, not as root.

Admittedly, this css does not specifically target the calendar (clock) applet. I'm not sure if that can be done. So there could be a problem if you have any other panel applets with text labels as they may end up the wrong size.

PS. If you want to change the actual font for this to a different one which is on your system, you could try also adding the line:

Code: Select all

font-family: "------";

replacing the dashes with the name of the font.
mentospl
Level 1
Level 1
Posts: 11
Joined: Tue Nov 10, 2015 9:45 am

Re: Modification of the Cinnamon panel clock

Post by mentospl »

Thank you very much for your help!

I have to think hard about whether manually editing the cinnamon.css file will bring me more benefits or more trouble in the future.
I have a couple of my family's LMDE5 machines under my care and everything works fantastic so I don't want to break anything.
I mean when there are some theme updates and the update manager starts screaming messages about changing files, then it can be frustrating for the user and my whole family will flood me with phones ;)

Edit:
The best solution would be if Cinnamon DE officially introduced more possibilities to modify the calendar/clock area, but I don't know if Clem looks here and reads it :)
Post Reply

Return to “Themes, Icons & Wallpaper”