FvwmScript ItemDraw - Multiline?

I’m using a simple TimeScript (I forget where I found it, I apologize to the creator :blush: ) that I’ve swallowed in a dock and will display the time. But I’m unable to display multiple lines - I would like to have the time displayed on one line and the date displayed on the next.

I’ve modified the TimeScript to look like this:

[code]WindowTitle {TimeScript}
WindowSize 100 22
Colorset 30

Init
Begin
Set $time = (GetOutput {date “+%l:%M %p%n%b %d”} 1 -1)
ChangeTitle 1 $time
End

PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 60)==0 Then
Begin
Set $time = (GetOutput {date “+%l:%M %p%n%b %d”} 1 -1)
ChangeTitle 1 $time
End
End

Widget 1
Property
Type ItemDraw
Size 100 21
Position 0 0
Font “Shadow=0 se:xft:Verdana:size=8”
Flags NoFocus NoReliefString
Main
Case message of
End[/code]

The “%n” in the date function outputs a line break. If I run this command (date “+%l:%M %p%n%b %d”) in a terminal, I get the correct output:

6:58 PM May 03

But I can’t get the second line to show up by using FvwmScript as such

*FvwmDock:      (5x2+19+1, Swallow "TimeScript" "FvwmScript TimeScript")

All I ever get is the first line showing the time. Am I missing something obvious? Thanks in advance for any help!

this works for me. it displays the date and weekday in the first line and in the line below the actual time. i have modified the standard date applet a bit. the key is using two widgets. you’ll get the idea.

 WindowTitle {FvwmApplet-cosDigitalClock}
 WindowSize  100 30      # Taille
 Font "xft:glisp:size=9:antialias=True"
 
 Init
  Begin
   Set $MainColorset=(GetScriptArgument 1)
   If $MainColorset <> {} Then
   Begin
    ChangeColorset 0 $MainColorset
    ChangeColorset 1 $MainColorset
    ChangeColorset 2 $MainColorset
   End
   Set $tmp = (GetOutput {exec date "+%a %d.%m.%Y %H:%M"} 1 -1)
   ChangeTitle 1 (StrCopy $tmp 0 13)
   ChangeTitle 2 (StrCopy $tmp 15 19)
 End
 
 PeriodicTasks
  Begin
   If (RemainderOfDiv (GetTime) 30)==0 Then
   Begin
   Set $tmp = (GetOutput {exec date "+%a %d.%m.%Y %H:%M"} 1 -1)
   ChangeTitle 1 (StrCopy $tmp 0 13)
   ChangeTitle 2 (StrCopy $tmp 15 19)
   End
 End
 
 Widget 1
 Property
  Position 0 3
  Size 100 15
  Type ItemDraw
  Flags NoReliefString
  Title {}
  Title {}
 Main
  Case message of
   SingleClic :
   Begin
   End
 End
 
 Widget 2
 Property
  Position 0 15
  Size 100 15
  Type ItemDraw
  Flags NoReliefString
  Title {}
 Main
  Case message of
   SingleClic :
   Begin
   End
 End

That idea didn’t even occur to me… thanks, it worked like a charm!