Adjustable Clock

Plasma 4 Extensions

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

28
8 .4
Description:

Plasmoid to show date and time in adjustable format using rich text.
Developed and tested on KDE 4.11 with Qt 4.8 (Kubuntu 13.10).

Source (main repository, with more frequent updates) is located at:
https://github.com/Emdek/plasmoid-adjustable-clock

Warning!
Version 4.0 (and newer) is not backwards compatible with 3.x, all custom formats need to be exported and manually converted.

QML themes support is currently considered as experimental, behavior and available API are not yet stable and most probably will be changed with next release.

Tips:
- to change tool tip text you need to set options toolTipExpressionMain and toolTipExpressionSub in applets configuration file (usually located at ~/.kde4/share/config/plasma-desktop-appletsrc), in group containing line plugin=adjustableclock;
- you can use advanced WebKit features (all of these that work with for example rekonq should work here too), for example use CSS to create reflections:

-webkit-box-reflect:below 5px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.5, transparent), to(white));

And much more. ;-)

If you created interesting theme and want to share it then post in comments!

Features:
- fully custom date and time using JavaScript API to obtain date and time components;
- multiple clock themes utilizing various designs;
- possibility to use rich text editor or edit source directly (HTML and CSS or QML) to adjust theme;
- context menu with actions to copy formatted (adjustable expressions) date and time to clipboard;
- fast copy to clipboard of adjustable date and time expression after middle mouse click on the clock or activation of keyboard shortcut;
- adjustable tool tip (hidden option, toolTipExpressionMain and toolTipExpressionSub keys);
- standard clock calendar.

If you have found bugs or have suggestions you can contact me via email, message or using comments, before you will vote bad. And remember that not everybody has enough time for fast replying. ;-)
Last changelog:

7 years ago

4.1.4 (01.11.2013):
- fixed week number not being updated;
- added missing title of "Insert Component" dialog.

4.1.3 (27.09.2013):
- ensure that component values are always up to date;
- adjust timestamp for time zone offset;
- do not allow for accidental nesting of components in editor;
- added option to hide date in Train Clock theme;
- added workaround to ensure that hands of SVG Clock have correct initial positions as soon as possible.

4.1.2 (01.06.2013):
- ensure that center of SVG Clock theme is always valid;
- improve resizing in vertical panels.

4.1.1 (25.05.2013):
- fixed WYSIWYG editor for HTML themes;
- fixed missing dialog for "Insert Component" actions.

4.1 (15.05.2013):
- added SVG Clock theme (analog clock that uses Plasma theme);
- added experimental support for QML themes (alpha state);
- added simple file templates for new themes;
- move theme editor to own dialog;
- move theme specific actions to context menu;
- added ability to install and export themes (Plasma Package ZIP);
- some other improvements and fixes.

9

lionhater

7 years ago

THANKS!

Well, in fact just before implementing your code I've seen my configuration to be (this time surprisingly) working as well, but your official version is better! And I'll prey for you!

Thank you.

Report

9

lionhater

7 years ago

Well, plasma desktop crashes constantly (in Manjaro).

Report

C

Emdek

7 years ago

Do you have any backtrace (generated by Dr Konqui)?

Report

9

lionhater

7 years ago

No, but I'd like to, if you can give a link to a howto.

Report

C

Emdek

7 years ago

These links may be helpful:
http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
http://techbase.kde.org/Development/FAQs/Debugging_FAQ
Which KDE version are you using? 32 or 64 bit?

Report

C

Emdek

7 years ago

Version 4.1 brings initial support for QML themes.
Currently it's pretty limited, there is no direct access to Clock API, no automatic zoom to fit contents to available rectangle (I'm not sure if it is even doable...), options are not available yet etc. Also it is not final yet and most probably will be not future compatible until next release.

Current approach is to define adjustableClock property on items which are supposed to display / process date and time components, for example:
property variant adjustableClock: {component: 'DayOfWeek', options: '\'text\': true'}
Will cause text property (by default, can be changed using attribute key) of specified item to be updated to current day of week in textual form.

Example theme:
http://paste.kde.org/744638/

I'm open for suggestions how to expose missing functionality in best way (and Plasma policies compatible).

Report

9

ksolsim

7 years ago

thanks for this new release... svg clock seems to not work, svg clock always gets 6:30..

http://postimg.org/image/bganfwn15/

Report

C

Emdek

7 years ago

Kind of confirmed, thanks for report. It happens randomly and debugging JS environment fails to tell why, maybe it's some kind of QtWebKit quirk, not sending repaint request for some reason...

This theme is a bit tricky, it loads uncompressed SVG theme file and manipulates transform property of clock hands (like simple Analog Clock, but on SVG and preserving initial transforms).

Report

herrbatka

7 years ago

Hi,

For some reason this clock does not refresh itself correctly after resuming from suspend/hibernate. At least hour stays the same as in the moment of suspend. Could you take look into this issue?

Report

C

Emdek

7 years ago

Thanks for report.
There are two possible sources for that issue, data engine (but then all other clocks should have the same issue) or QtWebKit (it might ignore redraw requests).
Could you please check with rekonq (since both use QtWebKit) if animation on this page works after resuming (or some other, JavaScript driven animations would be best)?
http://attasi.com/labs/analog-clock/
Also, do all themes have such issue? Some use events to update (LCD, Binary, beClock...). It would be best to check with two instances, for example one with Digital and one with Binary.

Report

herrbatka

7 years ago

http://attasi.com/labs/analog-clock/ works after resuming. Other clocks (including adjustable clock 3.0) works fine.

I use basic theme

<html><head></head><body style="font-family: Inconsolata; font-weight: bold; font-size: 48px; " background="true"><div style="text-align: center; font-size: 32px; font-family: Inconsolata; font-weight: bold; "><span component="Hour">12</span>:<span component="Minute">30</span></div></body></html>

Because default digital clock has text scaling issues.

It seems that after resuming hour component is not updated.

Report

C

Emdek

7 years ago

Only that one? That would be extremely weird.
I can't confirm that on my laptop (64 bit Kubuntu 11.10, KDE 4.8.4) using slightly modified version of your theme (seconds added), so it might be setup specific issue.
First we have to identify if it's redrawing, data updating issue or maybe something else.
Please add line:
qDebug() << "updating" << componentString;
To file applet/Clock.cpp after line 291 (const QLatin1String componentString = [...]), then recompile, open Konsole, kill plasma-desktop (kquitapp plasma-desktop), run plasma-desktop and observe output - if it will show lines like updating Second after resuming then it's not data updating issue and most probably something wrong with redrawing.

You can also try QML branch which uses WebView widget "directly" (well, through QML component ;-)):
https://github.com/Emdek/plasmoid-adjustable-clock/archive/qml.zip
Although it still has some issues, but should be usable (at least on desktop).

Report

herrbatka

7 years ago

QML branch clock is tiny. I can't make it bigger.

At the moment I'm not in the mood for debugging, sorry :/

Report

C

Emdek

7 years ago

Surely, but most important ones, like numerous (Qt)WebKit issues (some of them even older than applet itself, but still not fixed...), are beyond my scope. ;-(

Report

C

Emdek

7 years ago

I like when issues resolve themselves. :-)

Report

herrbatka

7 years ago

Don't worry. There will be always some bugs to fix. ;-)

Report

C

Emdek

7 years ago

You can try current snapshot, sizing in panels should be again correct.

Report

herrbatka

7 years ago

Problem does not exist anymore in the 4.1.

Report

C

Emdek

7 years ago

Here are some ideas for additional themes (which I may do not have enough time to implement or are too similar to existing ones to be bundled):
- geek clock (http://www.uncommongoods.com/product/geek-clock) - tip: MathML;
- tetris clock (multiple variants for details possible);
- spiral clock (http://www.superpunch.net/2011/01/spiral-clock.html);
- sundial.
If there will be enough interest I'll consider adding repository for addon themes and adding Install (from file and maybe later also GHNS) and Export actions to themes manager.

Report

C

Emdek

7 years ago

I've published snapshot of current master that soon will become v4.0.
Due to numerous changes I'm calling for testing before final release. Please report any issues here or on github project page.
Keep in mind that this version is not backwards compatible.

Report

9

ksolsim

7 years ago

Hi, I just realized the git package for arch, I noticed two problems, the first is the digital clock, the second is the vertical clock. For the rest seems to work well.
thanks for this great plasmoid

Report

C

Emdek

7 years ago

What exactly is wrong with them?
Screenshot could be useful. :-)

Report

9

ksolsim

7 years ago

if I choose the digital clock in its place is used beClock... the vertical clock problem can be seen in the screenshoot:
http://s16.postimg.org/mvnny17jp/avvio4.png

Report

C

Emdek

7 years ago

First one confirmed, that was bug in fallback mechanism.
Fixed, thanks for report. :-)

Second one is weird, should not happen at all.
It might be QtWebKit bug, since applet uses user stylesheet to set some CSS values including alignment.
All themes should be centered horizontally and vertically, and it seems that they are not on your machine (reason for broken previews).
Which Qt and KDE versions are you using?
32 or 64 system (for weird reasons that sometimes matters)?

Report

9

ksolsim

7 years ago

I tried the fixed fallback mechanism, but now if I choose the digital clock is displayed Analog clock.

Report

7 years ago

4.1.4 (01.11.2013):
- fixed week number not being updated;
- added missing title of "Insert Component" dialog.

4.1.3 (27.09.2013):
- ensure that component values are always up to date;
- adjust timestamp for time zone offset;
- do not allow for accidental nesting of components in editor;
- added option to hide date in Train Clock theme;
- added workaround to ensure that hands of SVG Clock have correct initial positions as soon as possible.

4.1.2 (01.06.2013):
- ensure that center of SVG Clock theme is always valid;
- improve resizing in vertical panels.

4.1.1 (25.05.2013):
- fixed WYSIWYG editor for HTML themes;
- fixed missing dialog for "Insert Component" actions.

4.1 (15.05.2013):
- added SVG Clock theme (analog clock that uses Plasma theme);
- added experimental support for QML themes (alpha state);
- added simple file templates for new themes;
- move theme editor to own dialog;
- move theme specific actions to context menu;
- added ability to install and export themes (Plasma Package ZIP);
- some other improvements and fixes.

12345678910
243
product-maker thevladsoft Aug 10 2015 9 excellent
product-maker vanguard7 Sep 01 2014 9 excellent
product-maker SicoBulo Jul 27 2014 3 bad
product-maker electron222 May 08 2014 9 excellent
product-maker janet Feb 22 2014 9 excellent
product-maker garthecho Feb 09 2014 9 excellent
product-maker renjooy Jan 24 2014 9 excellent
product-maker mixalns Nov 02 2013 9 excellent
product-maker MoonBlossom Oct 10 2013 9 excellent
product-maker vatsok Sep 29 2013 9 excellent
product-maker YAFU Sep 28 2013 9 excellent
product-maker fdservices Sep 27 2013 9 excellent
product-maker Omega9 May 16 2013 9 excellent
product-maker oOSplashOo May 15 2013 9 excellent
product-maker baltolkien May 04 2013 9 excellent
product-maker FraMari Apr 21 2013 9 excellent
product-maker monga Apr 21 2013 9 excellent
product-maker frag Apr 15 2013 9 excellent
product-maker SvenArcher Apr 14 2013 9 excellent
product-maker ArthurTaborda Apr 13 2013 9 excellent
product-maker ksolsim Apr 13 2013 9 excellent
product-maker migue Apr 13 2013 9 excellent
product-maker google01103 Apr 13 2013 9 excellent
product-maker evapor Apr 13 2013 9 excellent
product-maker unikum111 Apr 08 2013 9 excellent
product-maker tsujan Jan 06 2013 9 excellent
product-maker lionhater Oct 10 2012 9 excellent
product-maker quinnuendo Oct 03 2012 9 excellent
product-maker xMaki Oct 02 2012 9 excellent
product-maker CobraDOT Aug 13 2012 9 excellent
product-maker RAIDENSUB Jun 12 2012 9 excellent
product-maker remix Apr 03 2012 9 excellent
product-maker SeaJey Feb 15 2012 9 excellent
product-maker orivej Feb 13 2012 9 excellent
product-maker 5er Feb 07 2012 9 excellent
product-maker ZaWertun Feb 03 2012 9 excellent
product-maker cyberconan Jan 15 2012 9 excellent
product-maker CatchTime Dec 02 2011 9 excellent
product-maker paran0idx Dec 02 2011 9 excellent
product-maker deabru Dec 01 2011 9 excellent
product-maker vitoubien Dec 01 2011 9 excellent
product-maker e1nste1n Dec 01 2011 9 excellent
product-maker Pafrape Oct 12 2011 9 excellent
product-maker joseexposito89 Aug 30 2011 3 bad
product-maker ZXP6 Oct 15 2010 9 excellent
Be the first to comment
UnderTheGun
May 01 2014
quinnuendo
Mar 23 2014
BishopWolf
Jan 08 2014
MoonBlossom
Oct 10 2013
fdservices
Sep 27 2013
blue-dxca93
May 08 2013
baltolkien
May 04 2013
Maecla
May 04 2013
ArthurTaborda
Apr 13 2013
ksolsim
Apr 13 2013
migue
Apr 13 2013
elboulangero
Jan 07 2013
n-k
Jan 06 2013
xMaki
Oct 02 2012
CobraDOT
Aug 13 2012
Pafrape
Jun 15 2012
remix
Apr 03 2012
ZaWertun
Feb 03 2012
CatchTime
Dec 02 2011
paran0idx
Dec 02 2011
Bert
Aug 31 2010
olenz
May 11 2010
janet
Apr 30 2010
vazoline
Nov 02 2009
Pitmairen
Jul 02 2009
ahri
May 19 2009
deabru
Mar 27 2009
Sheridan
Mar 27 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
4.1.4 "Hello QML"
updated Nov 01 2013
added Nov 08 2008
downloads 24h
0
mediaviews 24h 0
pageviews 24h 5