3 IMG
=$1 # optional image file; exit when written
10 ## drawing a clock face
11 echo "drawingarea1:translate 10000 220 220"
12 echo "drawingarea1:set_line_cap 10000 round"
13 echo "drawingarea1:set_source_rgba 10000 black"
14 echo "drawingarea1:arc 10000 0 0 $R 0 360"
15 echo "drawingarea1:fill 10000"
17 echo "drawingarea1:set_font_face 10000 normal bold"
18 echo "drawingarea1:set_font_size 10000 25"
19 echo "drawingarea1:set_source_rgba 10000 white"
20 echo "drawingarea1:move_to 10000 0 30"
21 echo "drawingarea1:rel_move_for 10010 n Today"
22 echo "drawingarea1:show_text 10020 Today"
24 echo "drawingarea1:set_source_rgba 10000 rgba(255,255,0,.8)"
25 echo "drawingarea1:set_dash 10000"
26 echo "drawingarea1:set_line_width 10000 30"
27 echo "drawingarea1:move_to 10000 0 0"
28 echo "drawingarea1:arc 10030 0 0 $HRLN -90 -90"
29 echo "drawingarea1:stroke 10000"
31 echo "drawingarea1:set_source_rgba 10000 rgba(0,255,0,.7)"
32 echo "drawingarea1:set_dash 10000"
33 echo "drawingarea1:set_line_width 10000 25"
34 echo "drawingarea1:move_to 10000 0 0"
35 echo "drawingarea1:arc 10040 0 0 $MNLN -90 -90"
36 echo "drawingarea1:stroke 10000"
38 echo "drawingarea1:set_source_rgba 10000 cyan"
39 echo "drawingarea1:set_dash 10000 4 4"
40 echo "drawingarea1:set_line_width 10000 2"
41 echo "drawingarea1:move_to 10000 0 0"
42 echo "drawingarea1:arc 10050 0 0 $SCLN -90 -90"
43 echo "drawingarea1:stroke 10000"
44 ## now turning the hands by replacing some of the commands above
50 HR
=$
(((`date +"%s"`/1200%72*10)+270+720))
51 MN
=$
(((`date +"%s"`/20%180*2)+270+360))
52 SC
=$
((((`date +"%s"`%60)*6)+270))
54 if [[ HR
-ne HR0
]]; then
55 echo "drawingarea1:rel_move_for =10010 n $D"
56 echo "drawingarea1:show_text =10020 $D"
57 echo "drawingarea1:arc =10030 0 0 $HRLN $HR $HR"
61 if [[ MN
-ne MN0
]]; then
62 echo "drawingarea1:arc =10040 0 0 $MNLN $MN $MN"
66 echo "drawingarea1:arc =10050 0 0 $SCLN $SC $SC"
68 if [ -z "$IMG" ]; then # running clock
70 else # write image file and exit
71 echo "main:snapshot $IMG"
75 ) | .
/pipeglade
-u clock.ui