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

tsujan

7 years ago

The problem is fixed. Thanks a lot.

Report

C

Emdek

7 years ago

Thanks for testing. :-)

Report

9

fdservices

7 years ago

I have a similar problem. This morning, after resume from sleep, the time shown was the "sleep" time and the day says "Monday" - 27 Sept 13 is a Friday :(
Selecting the Adjustable Clock Settings and reinstalling the theme corrected the time but not the day.
Is the above fix in the downloads above 4.1.2? This is the one I used for installing on my Arch netbook

Andrew

Report

C

Emdek

7 years ago

Is that new issue reproducible?
Could you add testing instance with the same configuration but showing some additional timezone data (like timezone city name)?
Tooltip is unimportant in this case, it is default one for all kinds of clocks in Plasma (unless overwritten by custom settings).

Report

9

fdservices

7 years ago

I will try, but it has not happened again yet.

Andrew

Report

C

Emdek

7 years ago

It seems that you use incorrect component name, it should be:
<span component="DayOfWeek" options="'text': true">Saturday</span>
Anyway, thanks for reminding me that earlier mentioned fix should be finally released (along few other minor fixes). ;-)

Report

9

fdservices

7 years ago

Thank you

Report

C

Emdek

7 years ago

Nope, it is not and I forgot about that. ;-(
I was planning to finish weather integration earlier and release it all together, but that got delayed...
I will release new version soon, for now you can use code from master branch (secondary source download link).

Report

9

fdservices

7 years ago

Sorry to say that I have upgraded to 4.1.3 and the time was still incorrectly shown at boot this morning. I have three time zones selected, London, Paris and Bangkok. Clock default/Local time is set to Paris. The time shown at start up was Paris minus one hour = London. Right hover showed all the correct times including the bold Paris time. Selecting Adjustable Clock settings and OK reset the time to the correct Paris time.

Andrew

Report

9

fdservices

7 years ago

Wow - quick response, thanks.

I think that the day issue may be due to my theme, could you take a look please?

<span style="font-size: 12px;"><span component="Day">Monday</span></span><br>

FYI a restart did not correct the day, and hover does show the correct info.

Thanks

Andrew

Report

9

tsujan

7 years ago

I'll test it and tell you about the result :)

Report

C

Emdek

7 years ago

Those are send conditionally for a reason. ;-)
Proper solution would be to intercept resume signal or change comparison to compare with cached previous QDateTime value.
The latter probably makes more sense.

Report

9

tsujan

7 years ago

Yesterday I updated my installation of your great plasmoid from v3.1 to v4.1.2 and saw the same thing herrbatka had reported.

After resuming from hibernation, the hour figure isn't updated until the minute reaches 60. The same is true for the minute figure. The theme makes no difference. It seems that, in the code, the hour and minute figures are redrawn only once an hour and once a minute respectively (I haven't examined the code yet) so that the problem is visible only after >= 1 hour of hibernation/suspend.

Report

sash222

7 years ago

Hi,
my old config dont work with adjust-clock v4

toolTipFormatMain=now %!d %$M<br>
toolTipFormatSub=also %!D day of %Y y.

I tried

toolTipExpressionMain=now <span component="DayOfMonth" options="'short': true"></span> <span component="Month" options="'text': true" title="Month"></span><br>

but "syntax eror: parse error"

Report

C

Emdek

7 years ago

You should use the same syntax as used in Clipboard Actions editor.
For example:
Clock.getValue(Clock.Year) + '-' + Clock.getValue(Clock.Month) + '-' + Clock.getValue(Clock.DayOfMonth) + ' ' + Clock.getValue(Clock.Hour) + ':' + Clock.getValue(Clock.Minute) + ':' + Clock.getValue(Clock.Second)

Report

sash222

7 years ago

thank you

Report

9

lionhater

7 years ago

64 bit. Will look at those links.

Report

9

lionhater

7 years ago

Doesn't crash now!

Report

C

Emdek

7 years ago

But in case if it would happen again a backtrace would be very useful. :-)

Report

9

ksolsim

7 years ago

if I try to create a new theme in QML then plasma-desktop crashes... if it can be helpful here is the backtrace:

paste.kde.org/745976

Report

C

Emdek

7 years ago

Could you please rebuilt sources with debug symbols enabled (so backtrace will be more useful) and retry?

Report

9

lionhater

7 years ago

Yes, but I'll be very very careful not to crash!!

Report

9

lionhater

7 years ago

Whenever Adjustable Clock is updated I try to make date/time like so (in one line in the panel):

21:40 Thu 16 May

But I can't. If you could implement this as a preset I would prey for you!

In every other DE/WM this is either the default implementation or can easily be configured, but not in the otherwise richest, most configurable DE (KDE).

Report

C

Emdek

7 years ago

Something like that? ;-)
http://paste.kde.org/745262/
I'm considering adding Get Hot New Stuff support, then such themes could go to own repository.

Report

practica

7 years ago

Yes, I'd love to see a "Hot New Stuff" button on the Adjustable Clock...we were talking about this the other day. In the meantime, here's my code for a clock that we like, which works well for a semi-transparent vertical panel. It has shadowing and outline, so it stands out well on different backgrounds:

<html><head></head><body>
<div style="text-align: center;
font-family:'Ubuntu';
margin: 0 2 0 2;
color: rgb(0, 255, 0);
text-shadow: rgb(0, 0, 0) -2px 2px, rgb(0, 0, 0) 2px 2px, rgb(0, 0, 0) -2px -2px, rgb(0, 0, 0) 2px -2px, rgb(0, 0, 0) 0px 2px, rgb(0, 0, 0) 0px -2px, rgb(0, 0, 0) 2px 0px, rgb(0, 0, 0) -2px 0px, rgb(0, 170, 0) 0px 0px 15px, rgb(0, 170, 0) 0px 0px 15px;
font-weight: bold;">
<div style="font-size: 20px;"><span component="Hour" options="'short': true">12</span>:<span component="Minute">30</span></div>
<div style="font-size: 16px; text-transform: uppercase;"><span component="DayOfWeek" options="'short': true, 'text': true">Sat</span></div>
<div style="font-size: 13px; text-transform: uppercase;"><span component="Month" options="'short': true, 'text': true">Jan</span><span style="font-size: 21px;" component="DayOfMonth">01</span></div>
</div>
</body></html>

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
3
mediaviews 24h 0
pageviews 24h 19