kde clock format: how to include the day in a non-tiny font?

Solution 1:

QML

The KDE plasmoids are using qml scripts, http://en.wikipedia.org/wiki/QML .

The plasmoid scripts are at: /usr/share/plasma/plasmoids/... ie the digital clock scripts are at: /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/... You could edit those but any update will overwrite your changes.

The KDE TechBase has tutorial - Plasma5 QML2 GettingStarted: https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted .

The Date QML Type: http://doc.qt.io/qt-5/qml-qtqml-date.html

-> Date: enter image description here

-> Time: enter image description here

My panel clock

Writing a quick and dirty clock.

Making:

  • /tmp/mypanelclock/metadata.desktop: http://pastebin.com/PZe812VR
  • /tmp/mypanelclock/contents/ui/main.qml: http://pastebin.com/WqwD49N5
  • /tmp/mypanelclock/contents/ui/CompactRepresentation.qml: http://pastebin.com/9Ky7Fgj2

Opening a terminal window to the tmp directory and running command:

plasmapkg2 -i mypanelclock

The command:

:~$ plasmapkg2 --help
Usage: plasmapkg2 [options]
Plasma Package Manager

Options:
  -v, --version             Displays version information.
  -h, --help                Displays this help.
  --hash <path>             Generate a SHA1 hash for the package at <path>
  -g, --global              For install or remove, operates on packages
                            installed for all users.
  -t, --type <type>         The type of package, e.g. theme, wallpaper,
                            plasmoid, dataengine, runner, layout-template, etc.
  -i, --install <path>      Install the package at <path>
  -s, --show <name>         Show information of package <name>
  -u, --upgrade <path>      Upgrade the package at <path>
  -l, --list                List installed packages
  --list-types              List all known package types that can be installed
  -r, --remove <name>       Remove the package named <name>
  -p, --packageroot <path>  Absolute path to the package root. If not supplied,
                            then the standard data directories for this KDE
                            session will be searched instead.

Now there are available:

enter image description here

Adding the clock to the panel:

enter image description here

More of the KDE clocks: https://www.kubuntuforums.net/showthread.php?61798-Clocks

More of the qml & plasma 5: https://www.kubuntuforums.net/showthread.php?67726-Quick-KDE-plasma-qml-widgets

Solution 2:

Plasma 5.4.0 has changed the plasmoid to a horizontal format. This prevents the day from being tiny. However, it still doesn't allow full customisation of the format, so if you want the day displayed, it is extremely wide.

If you want to hack the plasmoid, you can patch /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/DigitalClock.qml as follows.

--- DigitalClock.qml.orig   2015-08-22 20:45:40.000000000 +1000
+++ DigitalClock.qml    2015-09-01 09:32:35.417197582 +1000
@@ -515,7 +515,7 @@

         if (main.showDate) {
             if (main.tooSmall) {
-                dateLabelLeft.text = Qt.formatDate(main.currentTime, main.dateFormat);
+                dateLabelLeft.text = Qt.formatDate(main.currentTime, "ddd d");
             } else {
                 dateLabel.text = Qt.formatDate(main.currentTime, main.dateFormat);
             }