kde时钟格式:如何以非小字体包含日期?

我在Kubuntu 15.04上使用KDE。

我希望我的任务栏时钟看起来像这样:

太阳19 15:11

(或AM / PM没问题,主要是日期/日期与时间相同的字体大小。我不需要我的电脑告诉我月份和年份,但我确实想要日期和日期 – 月。)

KDE默认数字时钟小程序的配置选项包括“显示日期”选项,但是将日/月/年放在TINY字体下,而不是使小程序更宽。 除此之外,您只能选择短日期或长日期格式,而不能自定义。 右键单击时钟 – >“设置时间格式”是您的语言环境的数字,时间等的KDE范围格式。 我只想更改时钟,而不是让我的文件时间戳以自定义格式显示。

那么有没有办法在GUI之外进行自定义? (除了修改代码和构建我自己的软件包版本之外,我的意思是。)或者如果没有,我将如何使用与KDE不同的时钟小程序,一个具有可定制的%字母格式的时钟格式字符串?

QML

KDE plasmoids使用qml脚本, http://en.wikipedia.org/wiki/QML 。

等离子体脚本位于:/ usr / share / plasma / plasmoids / …即数字时钟脚本位于:/usr/share/plasma/plasmoids/org.kde.plasma.digitalclock / …你可以编辑那些但任何更新都会覆盖您的更改。

KDE TechBase有教程 – Plasma5 QML2 GettingStarted: https ://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted。

日期QML类型: http : //doc.qt.io/qt-5/qml-qtqml-date.html

– >日期: 在此处输入图像描述

– >时间: 在此处输入图像描述

我的面板时钟

写一个快速而肮脏的时钟。

制造:

打开终端窗口到tmp目录并运行命令:

plasmapkg2 -i mypanelclock 

命令:

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

现在有:

在此处输入图像描述

将时钟添加到面板:

在此处输入图像描述

更多KDE时钟: https : //www.kubuntuforums.net/showthread.php? 61798-时钟

更多qml&plasma 5: https ://www.kubuntuforums.net/showthread.php?67726-Quick-KDE-plasma-qml-widgets

等离子体5.4.0已将等离子体模型改为横向格式。 这可以防止这一天变得微不足道。 但是,它仍然不允许完全自定义格式,因此如果您希望显示日期,则它非常宽。

如果你想破解等离子体,可以按如下方式修补/usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/DigitalClock.qml

 --- 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); }