On Sat, Jun 24, 2006 at 02:08:43PM +0000, Mikhael Goikhman wrote:
> 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. :)

Hm, I don't see that happen in the foreseeable future.  Nobody is
doing anything in that direction.

> 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.

Oh, but it doesn't.  All it relies on are the command line
arguments and the message format.  Both is documented.  The only
thing I did not care to find out in my script is the size and byte
order of a long.  (The SET_MASK stuff was left over from the
pre-ModuleListenOnly version and can be removed).

> >   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.

It exits when it gets a SIGPIPE, just like any other module.  Of
course you have to code it that way:

  trap 0 1 2 3 9 13 15 exit

> 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.

Fact is, starting FvwmCommand every time I want to send a command
disturbs the system because it needs to start a process.  With the
exception of the ps- and sort-commands, my fvwm_periodic module is
a pure zsh-script, and that's because I could not figure how to do
it without calling an external command.

And eventually I wasn't able to find out how to do it with
FvwmPerl by reading the man page (I'm a zsh-person, not a
Perl-person).

> 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.

That's the idea.  My script should eventually end up with its
portability issues fixed (although I don't see how all this could
be done without zsh).

> It is not very hard after reading "fvwm-perllib man".

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]

Attachment: signature.asc
Description: Digital signature

Reply via email to