Is there a way to set a shortcut-key for copying a text format of current date and time of KDE environment's calender?
-
You want a keyboard shortcut that copies the current date and time to the clipboard? – Seth Nov 14 '13 at 03:40
-
yep. – Minimus Heximus Nov 14 '13 at 03:43
2 Answers
Why do you intend to use KDE Calendar for such a simple task? Why not to define a global shortcut
System Setting › Shortcuts and Gestures › Custom Shortcuts › Edit › New › Global Shortcut › Command / URL
for
date | xsel -i -b
?
You may use any imaginable date format if default (Fri Dec 20 09:33:37 MSK 2013
)
does not suite you, see date(1)
. E. g. date '+%F %T'
will generate lexicographically sortable 2013-12-20 09:33:59
.
Instead of xsel -i -b
you also can use xclip -i -selection clipboard
.
I assume you want to copy to CLIPBOARD
. Use just xsel -i
or xclip -i
if you want to put date to PRIMARY
selection.

- 1,578
- 10
- 12
-
date(1)
is reference to the man page. Use$ man date
command or man:/date(1) URL in Konqueror. – Dmitry Alexandrov Dec 20 '13 at 05:49 -
I want KDE Calender because it has a local calender. btw, thanks this can be helpful and even more if you add a command for an immediate paste after copy. – Minimus Heximus Dec 20 '13 at 16:10
Thanks to Dmitry Alexandrov's answer above and wilf's answer, one can also set this command (as in answer above):
date '+%A, %Y/%m/%d %H:%M:%S' | xsel -i -b && xdotool type ' ' && xdotool key ctrl+v BackSpace && xdotool type ' '
which will copy and then immediately paste a format of date and time. Hotkey 'F8' seems to be appropriate and works for me:
Saturday, 2013/12/21 02:00:27
(other hotkeys may interfere with xdotool
).
Copying KDE date and time format is unsolved yet.

- 3,598