Is there a way to set a shortcut-key for copying a text format of current date and time of KDE environment's calender?
Ubuntu – Copy date and time of KDE calender in text format to clipboard
13.10kde
Related Solutions
You can use date
for that anyway:
date '+%A, %Y/%m/%d'
which will currently output
Friday, 2013/12/20
Just run date --help
to find out more...
For calendar specific, or at least locale specific, specific date names, try exporting the locale - e.g. this one:
export LC_TIME=am_ET.UTF-8
and then run the command again:
ዓርብ, 2013/12/20
You can list the locales with locale -a
- more on that here.
This bit is based on a lot of guessing...
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:
-> Time:
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:
Adding the clock to the panel:
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
Best Answer
Why do you intend to use KDE Calendar for such a simple task? Why not to define a global shortcut
for
?
You may use any imaginable date format if default (
Fri Dec 20 09:33:37 MSK 2013
) does not suite you, seedate(1)
. E. g.date '+%F %T'
will generate lexicographically sortable2013-12-20 09:33:59
.Instead of
xsel -i -b
you also can usexclip -i -selection clipboard
.I assume you want to copy to
CLIPBOARD
. Use justxsel -i
orxclip -i
if you want to put date toPRIMARY
selection.