Re: How to Display Date and Time in the active window title?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 03 February 2005 08:51, Markus Tacker wrote:
>    Hoi List,
>
>    I just want KDE to add the current date an time to my active window's
>    title bar.
>
>    Is this possible and how do i do it?

Well, a cron script and dcop should be able to do it, but not elegantly. I 
couldn't find an easy way to determine which window is active, but you can 
query indivudual windows easily enough:


esben@spurv mydvd $ sleep 3; dcop kmail 'kmail-mainwindow#1' isActiveWindow
true
esben@spurv mydvd $ sleep 3; dcop kmail 'kmail-mainwindow#1' isActiveWindow
false
esben@spurv mydvd $                                      

And setting the caption to include the current timestamp is easy as 1-2-3:

Get caption for kmail-mainwindow#1:
$ dcop kmail 'kmail-mainwindow#1' caption

Set caption for kmail-mainwindow#1
$ dcop kmail 'kmail-mainwindow#1' setCaption "My new caption"

Set caption to current date
$ dcop kmail 'kmail-mainwindow#1' setCaption $(date -u)

Append current date to caption:
$ dcop kmail 'kmail-mainwindow#1' setCaption "$(dcop kmail 
'kmail-mainwindow#1' caption) $(date -u)" 


If you are up for it, it should be doable. 

Cute idea, though. Consider adding it as a feature request to KWin.

-- 
regards. Esben
___________________________________________________
.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux