summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2011-06-06 20:50:47 +0000
committerBoris Faure <billiob@gmail.com>2011-06-06 20:50:47 +0000
commit6f0651d07fbba813af79105a661d0ba48f636a3d (patch)
tree4cfc90e376429398d5517fbd18870ea2274495d3
add a textual klok usable as an enlightenment wallpaper
SVN revision: 60007
-rwxr-xr-xbuild.sh2
-rw-r--r--klok.edc528
2 files changed, 530 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..f092915
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,2 @@
1#!/bin/sh
2edje_cc $@ -id . -fd . klok.edc -o klok.edj
diff --git a/klok.edc b/klok.edc
new file mode 100644
index 0000000..cf7f88b
--- /dev/null
+++ b/klok.edc
@@ -0,0 +1,528 @@
1/* Based on http://www.qlocktwo.com/ */
2collections {
3 group {
4 name: "e/desktop/background";
5
6 script {
7 public clock_cb(unused) {
8 new year, month, day, yearday, weekday, hour, minute;
9 new Float:second;
10
11 date(year, month, day, yearday, weekday, hour, minute, second);
12 // Callback every 5 minutes
13 timer(60 * (4 - (minute % 5)) + 60.0 - second, "clock_cb", 1);
14#define SHUTOFF(_name) \
15 set_state(PART:"on_"_name, "hidden", 0.0); \
16 set_state(PART:"off_"_name, "default", 0.0)
17
18 SHUTOFF("l0.0");
19 SHUTOFF("l1.0");
20 SHUTOFF("l2.0");
21 SHUTOFF("l3.0");
22 SHUTOFF("l4.0");
23 SHUTOFF("l5.0");
24 SHUTOFF("l6.0");
25 SHUTOFF("l7.0");
26 SHUTOFF("l8.0");
27 SHUTOFF("l9.0");
28 SHUTOFF("la.0");
29 SHUTOFF("l0.1");
30 SHUTOFF("l1.1");
31 SHUTOFF("l2.1");
32 SHUTOFF("l3.1");
33 SHUTOFF("l4.1");
34 SHUTOFF("l5.1");
35 SHUTOFF("l6.1");
36 SHUTOFF("l7.1");
37 SHUTOFF("l8.1");
38 SHUTOFF("l9.1");
39 SHUTOFF("la.1");
40 SHUTOFF("l0.2");
41 SHUTOFF("l1.2");
42 SHUTOFF("l2.2");
43 SHUTOFF("l3.2");
44 SHUTOFF("l4.2");
45 SHUTOFF("l5.2");
46 SHUTOFF("l6.2");
47 SHUTOFF("l7.2");
48 SHUTOFF("l8.2");
49 SHUTOFF("l9.2");
50 SHUTOFF("la.2");
51 SHUTOFF("l0.3");
52 SHUTOFF("l1.3");
53 SHUTOFF("l2.3");
54 SHUTOFF("l3.3");
55 SHUTOFF("l4.3");
56 SHUTOFF("l5.3");
57 SHUTOFF("l6.3");
58 SHUTOFF("l7.3");
59 SHUTOFF("l8.3");
60 SHUTOFF("l9.3");
61 SHUTOFF("la.3");
62 SHUTOFF("l0.4");
63 SHUTOFF("l1.4");
64 SHUTOFF("l2.4");
65 SHUTOFF("l3.4");
66 SHUTOFF("l4.4");
67 SHUTOFF("l5.4");
68 SHUTOFF("l6.4");
69 SHUTOFF("l7.4");
70 SHUTOFF("l8.4");
71 SHUTOFF("l9.4");
72 SHUTOFF("la.4");
73 SHUTOFF("l0.5");
74 SHUTOFF("l1.5");
75 SHUTOFF("l2.5");
76 SHUTOFF("l3.5");
77 SHUTOFF("l4.5");
78 SHUTOFF("l5.5");
79 SHUTOFF("l6.5");
80 SHUTOFF("l7.5");
81 SHUTOFF("l8.5");
82 SHUTOFF("l9.5");
83 SHUTOFF("la.5");
84 SHUTOFF("l0.6");
85 SHUTOFF("l1.6");
86 SHUTOFF("l2.6");
87 SHUTOFF("l3.6");
88 SHUTOFF("l4.6");
89 SHUTOFF("l5.6");
90 SHUTOFF("l6.6");
91 SHUTOFF("l7.6");
92 SHUTOFF("l8.6");
93 SHUTOFF("l9.6");
94 SHUTOFF("la.6");
95 SHUTOFF("l0.7");
96 SHUTOFF("l1.7");
97 SHUTOFF("l2.7");
98 SHUTOFF("l3.7");
99 SHUTOFF("l4.7");
100 SHUTOFF("l5.7");
101 SHUTOFF("l6.7");
102 SHUTOFF("l7.7");
103 SHUTOFF("l8.7");
104 SHUTOFF("l9.7");
105 SHUTOFF("la.7");
106 SHUTOFF("l0.8");
107 SHUTOFF("l1.8");
108 SHUTOFF("l2.8");
109 SHUTOFF("l3.8");
110 SHUTOFF("l4.8");
111 SHUTOFF("l5.8");
112 SHUTOFF("l6.8");
113 SHUTOFF("l7.8");
114 SHUTOFF("l8.8");
115 SHUTOFF("l9.8");
116 SHUTOFF("la.8");
117 SHUTOFF("l0.9");
118 SHUTOFF("l1.9");
119 SHUTOFF("l2.9");
120 SHUTOFF("l3.9");
121 SHUTOFF("l4.9");
122 SHUTOFF("l5.9");
123 SHUTOFF("l6.9");
124 SHUTOFF("l7.9");
125 SHUTOFF("l8.9");
126 SHUTOFF("l9.9");
127 SHUTOFF("la.9");
128
129
130#define SHUTON(_name) \
131 set_state(PART:"off_"_name, "hidden", 0.0); \
132 set_state(PART:"on_"_name, "default", 0.0)
133
134 SHUTON("l0.0");
135 SHUTON("l1.0");
136 SHUTON("l3.0");
137 SHUTON("l4.0");
138 if (0 <= minute && minute < 5) {
139 // OCLOCK
140 SHUTON("l5.9");
141 SHUTON("l6.9");
142 SHUTON("l7.9");
143 SHUTON("l8.9");
144 SHUTON("l9.9");
145 SHUTON("la.9");
146 }
147 if ((5 <= minute && minute < 10)
148 || (25 <= minute && minute < 30)
149 || (35 <= minute && minute < 40)
150 || (55 <= minute && minute < 60))
151 {
152 // FIVE
153 SHUTON("l6.2");
154 SHUTON("l7.2");
155 SHUTON("l8.2");
156 SHUTON("l9.2");
157 }
158 if ((10 <= minute && minute < 15)
159 || (50 <= minute && minute < 55))
160 {
161 // TEN
162 SHUTON("l5.3");
163 SHUTON("l6.3");
164 SHUTON("l7.3");
165 }
166 if ((15 <= minute && minute < 20)
167 || (45 <= minute && minute < 50))
168 {
169 // A QUARTER
170 SHUTON("l0.1");
171 SHUTON("l2.1");
172 SHUTON("l3.1");
173 SHUTON("l4.1");
174 SHUTON("l5.1");
175 SHUTON("l6.1");
176 SHUTON("l7.1");
177 SHUTON("l8.1");
178 }
179 if ((20 <= minute && minute < 30)
180 || (40 <= minute && minute < 45))
181 {
182 // TWENTY
183 SHUTON("l0.2");
184 SHUTON("l1.2");
185 SHUTON("l2.2");
186 SHUTON("l3.2");
187 SHUTON("l4.2");
188 SHUTON("l5.2");
189 }
190 if (30 <= minute && minute < 35) {
191 //HALF
192 SHUTON("l0.3");
193 SHUTON("l1.3");
194 SHUTON("l2.3");
195 SHUTON("l3.3");
196 }
197
198 if (5 <= minute && minute < 35) {
199 // PAST
200 SHUTON("l0.4");
201 SHUTON("l1.4");
202 SHUTON("l2.4");
203 SHUTON("l3.4");
204 }
205 if (35 <= minute && minute < 60) {
206 // TO
207 SHUTON("l9.3");
208 SHUTON("la.3");
209 }
210
211
212 // HOUR
213 if (hour == 0 || hour == 12) {
214 // TWELVE
215 SHUTON("l5.8");
216 SHUTON("l6.8");
217 SHUTON("l7.8");
218 SHUTON("l8.8");
219 SHUTON("l9.8");
220 SHUTON("la.8");
221 } else
222 if (hour == 1 || hour == 13) {
223 // ONE
224 SHUTON("l0.5");
225 SHUTON("l1.5");
226 SHUTON("l2.5");
227 } else
228 if (hour == 2 || hour == 14) {
229 // TWO
230 SHUTON("l8.6");
231 SHUTON("l9.6");
232 SHUTON("la.6");
233 } else
234 if (hour == 3 || hour == 15) {
235 // THREE
236 SHUTON("l6.5");
237 SHUTON("l7.5");
238 SHUTON("l8.5");
239 SHUTON("l9.5");
240 SHUTON("la.5");
241 } else
242 if (hour == 4 || hour == 16) {
243 // FOUR
244 SHUTON("l0.6");
245 SHUTON("l1.6");
246 SHUTON("l2.6");
247 SHUTON("l3.6");
248 } else
249 if (hour == 5 || hour == 17) {
250 // FIVE
251 SHUTON("l4.6");
252 SHUTON("l5.6");
253 SHUTON("l6.6");
254 SHUTON("l7.6");
255 } else
256 if (hour == 6 || hour == 18) {
257 // SIX
258 SHUTON("l3.5");
259 SHUTON("l4.5");
260 SHUTON("l5.5");
261 } else
262 if (hour == 7 || hour == 19) {
263 // SEVEN
264 SHUTON("l0.8");
265 SHUTON("l1.8");
266 SHUTON("l2.8");
267 SHUTON("l3.8");
268 SHUTON("l4.8");
269 } else
270 if (hour == 8 || hour == 20) {
271 // EIGHT
272 SHUTON("l0.7");
273 SHUTON("l1.7");
274 SHUTON("l2.7");
275 SHUTON("l3.7");
276 SHUTON("l4.7");
277 } else
278 if (hour == 9 || hour == 21) {
279 // NINE
280 SHUTON("l7.4");
281 SHUTON("l8.4");
282 SHUTON("l9.4");
283 SHUTON("la.4");
284 } else
285 if (hour == 10 || hour == 22) {
286 // TEN
287 SHUTON("l0.9");
288 SHUTON("l1.9");
289 SHUTON("l2.9");
290 } else
291 if (hour == 11 || hour == 23) {
292 // ELEVEN
293 SHUTON("l5.7");
294 SHUTON("l6.7");
295 SHUTON("l7.7");
296 SHUTON("l8.7");
297 SHUTON("l9.7");
298 SHUTON("la.7");
299 }
300
301 }
302 }
303
304 parts {
305 part {
306 name: "bg";
307 type: RECT;
308 description {
309 state: "default" 0.0;
310 color: 0 43 54 255;
311 }
312 }
313 part {
314 name: "bg.square";
315 type: RECT;
316 scale: 1;
317 description {
318 state: "default" 0.0;
319 color: 0 0 0 0;
320 min: 220 220;
321 align: 0.5 0.5;
322 aspect: 1.0 1.0;
323 aspect_preference: BOTH;
324 }
325 }
326
327 #define LETTER(_name, _x0, _y0, _x1, _y1, _letter) \
328 part { \
329 name: "off_"_name; \
330 type: TEXT; \
331 scale: 1; \
332 description { \
333 state: "default" 0.0; \
334 color: 88 110 117 255; \
335 fixed: 1 1; \
336 step: 10 11; \
337 rel1 { \
338 relative: _x0 _y0; \
339 to: "bg.square"; \
340 } \
341 rel2 { \
342 relative: _x1 _y1; \
343 to: "bg.square"; \
344 } \
345 text { \
346 font: "Sans:style=Mono"; \
347 size: 10; \
348 min: 1 1; \
349 fit: 1 1; \
350 align: 0.5 0.5; \
351 text: _letter; \
352 text_class: "klok_letter"; \
353 } \
354 } \
355 description { \
356 state: "hidden" 0.0; \
357 inherit: "default" 0.0; \
358 visible: 0; \
359 } \
360 } \
361 part { \
362 name: "on_"_name; \
363 type: TEXT; \
364 effect: GLOW; \
365 scale: 1; \
366 description { \
367 state: "default" 0.0; \
368 color: 253 246 227 255; \
369 fixed: 1 1; \
370 step: 10 11; \
371 rel1 { \
372 relative: _x0 _y0; \
373 to: "bg.square"; \
374 } \
375 rel2 { \
376 relative: _x1 _y1; \
377 to: "bg.square"; \
378 } \
379 text { \
380 font: "Sans:style=Mono"; \
381 size: 10; \
382 min: 1 1; \
383 fit: 1 1; \
384 align: 0.5 0.5; \
385 text: _letter; \
386 text_class: "klok_letter"; \
387 } \
388 } \
389 description { \
390 state: "hidden" 0.0; \
391 inherit: "default" 0.0; \
392 visible: 0; \
393 } \
394 }
395
396 LETTER("l0.0", 0, 0, 0.091, 0.1, "I")
397 LETTER("l1.0", 0.091, 0, 0.182, 0.1, "T")
398 LETTER("l2.0", 0.182, 0, 0.273, 0.1, "L")
399 LETTER("l3.0", 0.273, 0, 0.364, 0.1, "I")
400 LETTER("l4.0", 0.364, 0, 0.455, 0.1, "S")
401 LETTER("l5.0", 0.455, 0, 0.545, 0.1, "A")
402 LETTER("l6.0", 0.545, 0, 0.636, 0.1, "S")
403 LETTER("l7.0", 0.636, 0, 0.727, 0.1, "T")
404 LETTER("l8.0", 0.727, 0, 0.818, 0.1, "I")
405 LETTER("l9.0", 0.818, 0, 0.909, 0.1, "M")
406 LETTER("la.0", 0.909, 0, 1 , 0.1, "E")
407
408 LETTER("l0.1", 0, 0.1, 0.091, 0.2, "A")
409 LETTER("l1.1", 0.091, 0.1, 0.182, 0.2, "C")
410 LETTER("l2.1", 0.182, 0.1, 0.273, 0.2, "Q")
411 LETTER("l3.1", 0.273, 0.1, 0.364, 0.2, "U")
412 LETTER("l4.1", 0.364, 0.1, 0.455, 0.2, "A")
413 LETTER("l5.1", 0.455, 0.1, 0.545, 0.2, "R")
414 LETTER("l6.1", 0.545, 0.1, 0.636, 0.2, "T")
415 LETTER("l7.1", 0.636, 0.1, 0.727, 0.2, "E")
416 LETTER("l8.1", 0.727, 0.1, 0.818, 0.2, "R")
417 LETTER("l9.1", 0.818, 0.1, 0.909, 0.2, "D")
418 LETTER("la.1", 0.909, 0.1, 1 , 0.2, "C")
419
420 LETTER("l0.2", 0, 0.2, 0.091, 0.3, "T")
421 LETTER("l1.2", 0.091, 0.2, 0.182, 0.3, "W")
422 LETTER("l2.2", 0.182, 0.2, 0.273, 0.3, "E")
423 LETTER("l3.2", 0.273, 0.2, 0.364, 0.3, "N")
424 LETTER("l4.2", 0.364, 0.2, 0.455, 0.3, "T")
425 LETTER("l5.2", 0.455, 0.2, 0.545, 0.3, "Y")
426 LETTER("l6.2", 0.545, 0.2, 0.636, 0.3, "F")
427 LETTER("l7.2", 0.636, 0.2, 0.727, 0.3, "I")
428 LETTER("l8.2", 0.727, 0.2, 0.818, 0.3, "V")
429 LETTER("l9.2", 0.818, 0.2, 0.909, 0.3, "E")
430 LETTER("la.2", 0.909, 0.2, 1 , 0.3, "X")
431
432 LETTER("l0.3", 0, 0.3, 0.091, 0.4, "H")
433 LETTER("l1.3", 0.091, 0.3, 0.182, 0.4, "A")
434 LETTER("l2.3", 0.182, 0.3, 0.273, 0.4, "L")
435 LETTER("l3.3", 0.273, 0.3, 0.364, 0.4, "F")
436 LETTER("l4.3", 0.364, 0.3, 0.455, 0.4, "B")
437 LETTER("l5.3", 0.455, 0.3, 0.545, 0.4, "T")
438 LETTER("l6.3", 0.545, 0.3, 0.636, 0.4, "E")
439 LETTER("l7.3", 0.636, 0.3, 0.727, 0.4, "N")
440 LETTER("l8.3", 0.727, 0.3, 0.818, 0.4, "F")
441 LETTER("l9.3", 0.818, 0.3, 0.909, 0.4, "T")
442 LETTER("la.3", 0.909, 0.3, 1 , 0.4, "O")
443
444 LETTER("l0.4", 0, 0.4, 0.091, 0.5, "P")
445 LETTER("l1.4", 0.091, 0.4, 0.182, 0.5, "A")
446 LETTER("l2.4", 0.182, 0.4, 0.273, 0.5, "S")
447 LETTER("l3.4", 0.273, 0.4, 0.364, 0.5, "T")
448 LETTER("l4.4", 0.364, 0.4, 0.455, 0.5, "E")
449 LETTER("l5.4", 0.455, 0.4, 0.545, 0.5, "R")
450 LETTER("l6.4", 0.545, 0.4, 0.636, 0.5, "U")
451 LETTER("l7.4", 0.636, 0.4, 0.727, 0.5, "N")
452 LETTER("l8.4", 0.727, 0.4, 0.818, 0.5, "I")
453 LETTER("l9.4", 0.818, 0.4, 0.909, 0.5, "N")
454 LETTER("la.4", 0.909, 0.4, 1 , 0.5, "E")
455
456 LETTER("l0.5", 0, 0.5, 0.091, 0.6, "O")
457 LETTER("l1.5", 0.091, 0.5, 0.182, 0.6, "N")
458 LETTER("l2.5", 0.182, 0.5, 0.273, 0.6, "E")
459 LETTER("l3.5", 0.273, 0.5, 0.364, 0.6, "S")
460 LETTER("l4.5", 0.364, 0.5, 0.455, 0.6, "I")
461 LETTER("l5.5", 0.455, 0.5, 0.545, 0.6, "X")
462 LETTER("l6.5", 0.545, 0.5, 0.636, 0.6, "T")
463 LETTER("l7.5", 0.636, 0.5, 0.727, 0.6, "H")
464 LETTER("l8.5", 0.727, 0.5, 0.818, 0.6, "R")
465 LETTER("l9.5", 0.818, 0.5, 0.909, 0.6, "E")
466 LETTER("la.5", 0.909, 0.5, 1 , 0.6, "E")
467
468 LETTER("l0.6", 0, 0.6, 0.091, 0.7, "F")
469 LETTER("l1.6", 0.091, 0.6, 0.182, 0.7, "O")
470 LETTER("l2.6", 0.182, 0.6, 0.273, 0.7, "U")
471 LETTER("l3.6", 0.273, 0.6, 0.364, 0.7, "R")
472 LETTER("l4.6", 0.364, 0.6, 0.455, 0.7, "F")
473 LETTER("l5.6", 0.455, 0.6, 0.545, 0.7, "I")
474 LETTER("l6.6", 0.545, 0.6, 0.636, 0.7, "V")
475 LETTER("l7.6", 0.636, 0.6, 0.727, 0.7, "E")
476 LETTER("l8.6", 0.727, 0.6, 0.818, 0.7, "T")
477 LETTER("l9.6", 0.818, 0.6, 0.909, 0.7, "W")
478 LETTER("la.6", 0.909, 0.6, 1 , 0.7, "O")
479
480 LETTER("l0.7", 0, 0.7, 0.091, 0.8, "E")
481 LETTER("l1.7", 0.091, 0.7, 0.182, 0.8, "I")
482 LETTER("l2.7", 0.182, 0.7, 0.273, 0.8, "G")
483 LETTER("l3.7", 0.273, 0.7, 0.364, 0.8, "H")
484 LETTER("l4.7", 0.364, 0.7, 0.455, 0.8, "T")
485 LETTER("l5.7", 0.455, 0.7, 0.545, 0.8, "E")
486 LETTER("l6.7", 0.545, 0.7, 0.636, 0.8, "L")
487 LETTER("l7.7", 0.636, 0.7, 0.727, 0.8, "E")
488 LETTER("l8.7", 0.727, 0.7, 0.818, 0.8, "V")
489 LETTER("l9.7", 0.818, 0.7, 0.909, 0.8, "E")
490 LETTER("la.7", 0.909, 0.7, 1 , 0.8, "N")
491
492 LETTER("l0.8", 0, 0.8, 0.091, 0.9, "S")
493 LETTER("l1.8", 0.091, 0.8, 0.182, 0.9, "E")
494 LETTER("l2.8", 0.182, 0.8, 0.273, 0.9, "V")
495 LETTER("l3.8", 0.273, 0.8, 0.364, 0.9, "E")
496 LETTER("l4.8", 0.364, 0.8, 0.455, 0.9, "N")
497 LETTER("l5.8", 0.455, 0.8, 0.545, 0.9, "T")
498 LETTER("l6.8", 0.545, 0.8, 0.636, 0.9, "W")
499 LETTER("l7.8", 0.636, 0.8, 0.727, 0.9, "E")
500 LETTER("l8.8", 0.727, 0.8, 0.818, 0.9, "L")
501 LETTER("l9.8", 0.818, 0.8, 0.909, 0.9, "V")
502 LETTER("la.8", 0.909, 0.8, 1 , 0.9, "E")
503
504 LETTER("l0.9", 0, 0.9, 0.091, 1, "T")
505 LETTER("l1.9", 0.091, 0.9, 0.182, 1, "E")
506 LETTER("l2.9", 0.182, 0.9, 0.273, 1, "N")
507 LETTER("l3.9", 0.273, 0.9, 0.364, 1, "S")
508 LETTER("l4.9", 0.364, 0.9, 0.455, 1, "E")
509 LETTER("l5.9", 0.455, 0.9, 0.545, 1, "O")
510 LETTER("l6.9", 0.545, 0.9, 0.636, 1, "C")
511 LETTER("l7.9", 0.636, 0.9, 0.727, 1, "L")
512 LETTER("l8.9", 0.727, 0.9, 0.818, 1, "O")
513 LETTER("l9.9", 0.818, 0.9, 0.909, 1, "C")
514 LETTER("la.9", 0.909, 0.9, 1 , 1, "K")
515 }
516 // Get everything started at load
517 programs {
518 program {
519 name: "init";
520 signal: "load";
521 source: "";
522 script {
523 clock_cb(0);
524 }
525 }
526 }
527 }
528}