On Wed, Feb 02, 2005 at 06:42:19PM +0000, Mikhael Goikhman wrote:
> On 01 Feb 2005 12:41:25 +0100, Uwe Pross wrote:
> > 
> > On 29 Jan 2005 at 14:26:03 +1100, Scott Smedley wrote:
> > 
> > > Further examples are available at:
> > > 
> > > http://users.tpg.com.au/users/scottie7/tmp/config.if
> > > 
> > > ...
> > > 
> > > Any comments/criticism most welcome.
> > 
> > AddToMenu my_menu
> > if ! ShellCmd /opt/myprogram 
> > + "My Program menu" Menu my_program_menu
> > endif
> > 
> > This should be possible.?
> 
> Well, strictly speaking. you may already do this intuitively:
> 
>   AddToMenu my_menu
>   Test (x myprogram) + "My Program menu" Menu my_program_menu
> 
> Similarly, you may already implement any need for if-else using TestRc.
> But I do agree that in the general case, the real if-else-elsif-endif
> syntax is a better (more intuitive) attempt at scripting than TestRc,
> functions and Break.
> 
> Well, this new syntax is very similar to the one suggested in the thread:
>   http://www.hpc.uh.edu/fvwm/archive/0108/msg00044.html
> At that time the short construct made sence, now it is already possible.
> 
> This patch seems to be good and complete overall. It may be applied later
> (probably after 2.6.0, if we want to ever release it).

Some time ago (strictly speeking on 4 october 2004 ;-) I've sent here a
small patch which can do similar things, but with additional help of
PipeRead (so no ShellCmd). My patch doesn't provide so much fexibility
as the if-else-elsif-endif syntax, but has one big advantage: it's
completly transparent for users, that don't want to use it. Virtualy no
change in any config should be needed, for fvwm with my patch applied.
My patch simply adds a new Test option named Compare for comparing two
values. That's why PipeRead is still needed - you have to set the values
to compare.

Details could be found in the archive:
http://www.hpc.uh.edu/fvwm/archive/0410/msg00033.html

I'd really like to see this patch merged into main tree before 2.6.0,
but I don't have much hope... ;-)
Of course if-else-elsif-endif syntax would be even nicer to have,
but I agree that this can wait till 2.6.0 (together with extended
conditionals: Name/IconName/Class/Resource/AnyName :-( )

PS. As usual sorry for my english.

-- 
Rafal Bisingier

Attachment: pgpjn4snSAoOq.pgp
Description: PGP signature

Reply via email to