I’d like to have a small clock with integrated date.
I want to use FvwmButtons for this, something like*Clock: Rows 3
*Clock: Columns 1
*Clock: (2x1, "Something that changes the title every second to the output from 'date +%H%M%S'")
*Clock: (1x1, "Something that changes the title when the day changes)
I know that I should probably use PipeRead for this but I don’t know how I could update it every second, and if I knew i wouln’d know if it was very good at all (in terms of keeping the memory and cpu usage low)
Another thing: Can I use 2 different fonts in the time-line and the date-line?
Why not just use xclock which can display what you want?
This would be ineffecient, although it’s possibe to do via an external script which uses FvwmCommand to SendToModule an FvwmButtons instance. See the following for an idea:
No, but then you would really be using FvwmScript for this – in fact, there’s several examples of FvwmScript stuff in /usr/share/data/fvwm which already does what you want.
Here’s the script:[code]WindowTitle {Time}
WindowSize 75 52
Init
Begin
Set $time = (GetOutput {exec date +%H:%M""} 1 -1)
Set $date = (GetOutput {date “+%a %e %b”} 1 -1)
ChangeTitle 1 $time
ChangeTitle 2 $date
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 60)==0 Then
Begin
Set $time = (GetOutput {exec date +%H:%M""} 1 -1)
Set $date = (GetOutput {date “+%a %e %b”} 1 -1)
ChangeTitle 1 $time
ChangeTitle 2 $date
End
End
Widget 1
Property
Size 75 26
Position 0 0
Colorset 51
Font “xft:Arial:pixelsize=16:bold”
Type ItemDraw
Flags NoReliefString
End
Widget 2
Property
Size 75 26
Position 0 26
Colorset 52
Font “xft:Arial:pixelsize=15”
Type ItemDraw
Flags NoReliefString
End[/code]
Also the entry in my taskbar:*FvwmDocks: (5x7+27+0, Swallow "Time" `FvwmScript $[fvwm_script]/FvwmScript-Time`)
It either doesn’t exist (good!) or if it does, it needs changing, and your FvwmScript file placed therein. To be honest, the declaration of fvwm_script as an environment variable is not needed, I would instead just copy your FvwmScript-Time file to $HOME/.fvwm and change the above line to: