Ubuntu – Kde clock format: how to include the day in a non-tiny font

clockkdekubuntuqml

I'm using KDE on Kubuntu 15.04.

I want my taskbar clock to look like this:

Sun 19 15:11

(or AM/PM would be ok, main thing is Day / Date in the same font size as the time. I don't need my computer to tell me the month and year, but I do want the day and date-of-month.)

The config options for KDE's default Digital Clock applet include a "Show Date" option, but that puts the day/month/year in a TINY font under the time, instead of making the applet wider. Besides that, you can only choose short or long date format, not custom. Right click on the clock -> "Set Time Format" is the KDE-wide formatting of numbers, times, etc for your locale. I just want to change the clock, not have my file timestamps show up in a custom format.

So is there a way to customize this outside the GUI? (Other than modifying the code and building my own version of the package, I mean.) Or if not, how would I go about using a different clock applet with KDE, one that has a clock format customizable with a %letter format-string?

Best Answer

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:

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