update a widget every second

Hi,
I wanted to create an applet which updates every second. But what i noticed was, after starting the script, the widgets gets updated only every two seconds. is this a general bug, or do i miss something?

Here is an example with an FvwmScript-Clock:

WindowTitle	{Clock}
WindowSize	65 20
Colorset	5

Init
Begin
	Set $time = (GetOutput {date "+%R:%S"} 1 -1)
	ChangeTitle 1 $time
End

PeriodicTasks
Begin 
	Set $time = (GetOutput {date "+%R:%S"} 1 -1)
	ChangeTitle 1 $time
End

Widget			1
Property
	Type		ItemDraw
	Size		65 20
	Position	0 0
	Font		"xft:Bitstream Vera Sans:Bold:pixelsize=12"
	Flags		NoFocus NoReliefString
End

AFAIK, it’s deliberate so that the script doesn’t enter into a possible endless loop. I’d have to check the source to confirm this, though.

– Thomas Adam

well, this periodic task thingy is an endless loop, isn’t it? so why this limitation?

greetings

The PeriodicTask feature isn’t all that reliable.

I wrote a replacement QuitVerify box using FvwmScript and it would count down to -34 or so before it started counting seconds. I also have a panel button that cycles through a number sequence of applications, one every five seconds. The timing on that seems a little erratic as well.

It’s ok if you need fairly regular updates and the timing isn’t critical, but it may well be broken for any sort of precision work.

There were (IIRC) some patches to the CVS version that attempted to fix this issue, so go look there.

– Thomas Adam

Right now I’m not doing anything time critical, and I solved a lot of the problem by keeping the timestamp from the previous hit and making sure the counter had in fact advanced. I’ll wait for the patches to go mainstream, I think.

Nice to know, though. :slight_smile:

Do the patches address heller’s problem as well, or is that a separate issue?

I’d have to check the CVS changelogs, but I believe they do – I can’t anymore specific until I check them.

– Thomas Adam