Wed Jul 20, 2016 12:14 am
Recently upgrading from KDE 4 to KDE 5 (far less painful that past major upgrades, and I have to say that it looks really good).
The are annoyances of course, and one that is on my mind now is the time format of the system clock widget. I want a simple clock with nothing but the time in %H:%M:%S format, which was what I had with KDE4 (formats are from 'man date').
With KDE 5, the format is %k:%M:%S - which means that twice a day the number of digits displayed changes. UGH! I would really like some way to return the the KDE 4 behavior. Is there some way of doing that, and if there is no easy fix, can someone point me to the file that controls that widget, I might be able to patch it (no guarantee of success - I am not a programmer, but I am certainly going to try).
Wed Jul 20, 2016 9:55 am
KDE Brainstorm: Improve Locale Configuration in Plasma 5 - viewtopic.php?f=83&t=124741
At here, editing the digital clock qml scripts to get what I want.
My Digital Clock
(This is with the plasma 5.7.2.)
Plasma 5 is using qml to draw the clocks. QML date and time formats can be found from the http://doc.qt.io/qt-5/qml-qtqml-date.html .
The plasma digital clock qml scripts are at the /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/. The user can edit the codes at the /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/ but the plasma updates will overwrite the edits.
A bit better way is to copy the scripts to the users home and rename the digital clock.
Copying the /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/ to the ~/.local/share/plasma/plasmoids/org.kde.plasma.mydigitalclock/.
Editing the ~/.local/share/plasma/plasmoids/org.kde.plasma.mydigitalclock/metadata.desktop:
Restarting the plasmashell or log out - log in.
Adding the My Digital clock to the panel:
My Digital Clock can be added to the My Panel: viewtopic.php?f=66&t=133073&hilit=panel#p357392
More of time&date formats:
- Wrong time format in plasma5 lock screen: viewtopic.php?f=289&t=130484
- How to set Monday as the first day of calendar widget?: viewtopic.php?f=66&t=131758
The digitalclock calendar qml code is at CalendarView.qml
A picture can be slipped to the calendar by adding a picture and few code lines ( http://doc.qt.io/qt-5/qml-qtquick-image.html ):
After plasmashell restart:
Monthly calendar background image
Monthly background images can be added by
Monthly pictures are at Images subdirectory:
and the names are 0,1,2,..11.
To get a bit better readability there is a matte image:
After plasmashell restart:
With the Plasma 5.11.
The KOrganizer starting with the mouse middle click: https://youtu.be/j2gslAS8tFI
Code of .../contents/ui/CalendarView.qml: https://pastebin.com/M15CZXSv
With the Plasma 5.14
Digital clock time is
My Digital clock time is:
Digital clock date is
My Digital clock date is
Last edited by Rog131 on Wed Jan 09, 2019 11:16 am, edited 3 times in total.
Fri May 26, 2017 1:08 pm
Thanks Rog131 for figuring this all out.
However, I tried this in Kubuntu 16.04, Plasma 5.8.6 (backported PPA) but could not get it to work. The "My Digital Clock" widget didn't even appear in the Add Widgets dialog. After double checking everything I had a hunch that the metadata.json file in the same folder as the metadata.desktop file needed to be edited in a similar manner so they matched. I edited lines 10, 19, 51, 55 (I think this was the key line), 57, 140.
After editing metadata.json and restarting, the "My Digital Clock" widget did appear in the Add Widgets dialog and it is working perfectly. I have my time displayed now as "12.05 am" (lowercase am/pm) and my date as "Sat, 27 May 2017" (abbreviated day string) ... exactly what I wanted.
Tue Jul 30, 2019 12:45 pm
I abandoned this fiddly approach to getting a more flexible time/date display some time ago. I now use an excellent Plasma widget called "Event Calendar" to replace the standard time/date display. This widget has a wealth of configuration options including displaying the time/date in different colours if you want. It also has weather/calendar information too.
To install the widget just click on the "Get new widgets" box at the bottom of the add widgets dialog and search for "Event Calendar".
Hope this helps.