On 24 Jun 2006 13:58:30 +0200, Dominik Vogt wrote:
> 
> I have just checked in the new command ModuleListenOnly.  It works
> like Module, but fvwm does not send any messages to such a module.
> 
> I am using it to attach a shell script to the module interface
> that periodically updates titles of FvwmButtons to display a clock
> (in the format I prefer, xclock is too stupid) and the process
> that currently consumes most cpu.

I can't say I am very happy about this. Actually, I would not be happy
about any new feature added without discussion before 2.6.0. :)

The problem with this solution is that in order to use it, every script
should include non obvious parts of the module interface, and once the
interface is changed such scripts stop to work correctly.

>   AddToFunc InitFunction
>   + I ModuleListenOnly /home/users/bin/fvwm_periodic ...
> 
>   AddToFunc RestartFunction
>   + I ModuleListenOnly /home/users/bin/fvwm_periodic ...

I would use StartFunction here, once. But, if I understand correctly, the
script does not quit when you quit or restart fvwm (because a pseudo
module does not really communicate with fvwm), so you also need to kill
it in ExitFunction.

I may see several solutions using the existing commands and not having
such problems. FvwmCommandS and Exec is one solution that doesn't require
the module protocol knowledge. There are several perl-based solutions.

We may write a module FvwmButtonsUpdater that gets an FvwmButtons module
name (alias) and a list of entries, each is: a button id, its update
frequency and a shell command to invoke for title updates (for example,
'date +%T' or 'ps -A --format "%C %P %c" | sort -n -r | head -1').

Maybe someone will write such configurable module, useful for everybody.
It is not very hard after reading "fvwm-perllib man".

Regards,
Mikhael.

Reply via email to