File: FvwmScript-Clock-24h

package info (click to toggle)
fvwm-crystal 3.4.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 21,708 kB
  • sloc: sh: 3,265; cs: 1,335; python: 875; makefile: 214
file content (64 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# o Support for temporary switch for display date/time after click on widget
#   LiNiO <linio@wonder.pl> - 2005.01.16
#


WindowTitle {FvwmScript-Clock}
WindowSize  60 22
Font		"xft:Tahoma:pixelsize=16:Bold"
Colorset 12

Init
 Begin
   Set $display= time

# 24-hour clock
  Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
# 12-hour clock
#  Set $tmp = (GetOutput {exec date "+%I:%M"} 1 -1)

  ChangeTitle 1 $tmp
End

PeriodicTasks
 Begin 
  If (RemainderOfDiv (GetTime) 60)==0 Then
  Begin

# 24 hour clock
    Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
# 12-hour clock
#    Set $tmp = (GetOutput {exec date "+%I:%M"} 1 -1)

    ChangeFont 1 {xft:Tahoma:pixelsize=16:Bold}
    ChangeTitle  1 $tmp
  End
End

Widget 1
Property
 Position 0 -3
 Size 60 22
 Type ItemDraw
 Flags NoReliefString
 Title {}
 Colorset 12
Main
 Case message of
  SingleClic :
  Begin
    If $display=={time} Then
    Begin
      Set $display= date
      ChangeFont 1 {xft:Tahoma:pixelsize=16:Bold}
      Set $tmp = (GetOutput {exec date "+%d/%m"} 1 -1)
    End
    Else
    Begin
      Set $display= time
      ChangeFont 1 {xft:Tahoma:pixelsize=16:Bold}
      Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
    End
    ChangeTitle  1 $tmp
  End
End