2

Is there a way to set a shortcut-key for copying a text format of current date and time of KDE environment's calender?

2 Answers2

1

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.

Dmitry Alexandrov
  • 1,578
  • 10
  • 12
0

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.