Debian Codegraph @

fvwm/components/scripts/FvwmScript-Clock-24h

raw
1 # o Support for temporary switch for display date/time after click on widget
2 # LiNiO <[email protected]> - 2005.01.16
3 #
4
5
6 WindowTitle {FvwmScript-Clock}
7 WindowSize 60 22
8 Font "xft:Tahoma:pixelsize=16:Bold"
9 Colorset 12
10
11 Init
12 Begin
13 Set $display= time
14
15 # 24-hour clock
16 Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
17 # 12-hour clock
18 # Set $tmp = (GetOutput {exec date "+%I:%M"} 1 -1)
19
20 ChangeTitle 1 $tmp
21 End
22
23 PeriodicTasks
24 Begin
25 If (RemainderOfDiv (GetTime) 60)==0 Then
26 Begin
27
28 # 24 hour clock
29 Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
30 # 12-hour clock
31 # Set $tmp = (GetOutput {exec date "+%I:%M"} 1 -1)
32
33 ChangeFont 1 {xft:Tahoma:pixelsize=16:Bold}
34 ChangeTitle 1 $tmp
35 End
36 End
37
38 Widget 1
39 Property
40 Position 0 -3
41 Size 60 22
42 Type ItemDraw
43 Flags NoReliefString
44 Title {}
45 Colorset 12
46 Main
47 Case message of
48 SingleClic :
49 Begin
50 If $display=={time} Then
51 Begin
52 Set $display= date
53 ChangeFont 1 {xft:Tahoma:pixelsize=16:Bold}
54 Set $tmp = (GetOutput {exec date "+%d/%m"} 1 -1)
55 End
56 Else
57 Begin
58 Set $display= time
59 ChangeFont 1 {xft:Tahoma:pixelsize=16:Bold}
60 Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
61 End
62 ChangeTitle 1 $tmp
63 End
64 End