File: FvwmScript-Clock-small_date

package info (click to toggle)
fvwm-crystal 3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 21,700 kB
  • ctags: 1,494
  • sloc: sh: 3,265; cs: 1,335; python: 875; makefile: 214
file content (52 lines) | stat: -rw-r--r-- 883 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
WindowTitle {FvwmScript-Clock-small_date}
WindowSize  114 20
Font		"xft:Verdana:pixelsize=12:Bold"
Colorset 12

Init
 Begin
  If (GetOutput {date "+%p"} 1 -1)=={} Then
  Begin
    Set $mode={24}
    Set $timecmd={date "+%a %e, %R"}
  End
  Else
  Begin
    Set $mode={12}
    Set $timecmd={LC_TIME=C date "+%a %e, %I:%M %p"}
  End

  ChangeTitle 1 (GetOutput $timecmd 1 -1)
End

PeriodicTasks
 Begin 
  If (RemainderOfDiv (GetTime) 60)==0 Then
    ChangeTitle  1 (GetOutput $timecmd 1 -1)
End

Widget 1
Property
 Position 0 -3
 Size 114 20
 Type ItemDraw
 Flags NoReliefString
 Title {}
 Colorset 12
Main
 Case message of
  SingleClic :
  Begin
  If $mode=={24} Then
  Begin
    Set $mode={12}
    Set $timecmd={LC_TIME=C date "+%a %e, %I:%M %p"}
  End
  Else
  Begin
    Set $mode={24}
    Set $timecmd={date "+%a %e, %R"}
  End
  ChangeTitle  1 (GetOutput $timecmd 1 -1)
  End
End