--On Friday, March 26, 2004 09:41:53 +0100 Uwe Pross <[EMAIL PROTECTED]> wrote:
> Hi there, > > On 26 Mar 2004 at 18:34:53 +1100, Scott Smedley wrote: > >> Is there a better way (less code?) of conditionally adding >> menu items to a menu than this? > > Currently I use: > > ... > PipeRead "test -x /opt/mozilla-sc-1.5/mozilla/mozilla && echo '+ > \"Mozilla %mini.mozilla.xpm%\" Function FuncStartProgram > /opt/mozilla-sc-1.5/mozilla/mozilla'" ... > > which is quite ugly but does not need a preprocessor. > > Since this is a very common problem it would be nice if this > would be part of the fvwm configuration language. > > Cheers, Uwe You could make it more generic, AddToFunc CondAdd I Test (f $0) AddToMenu $1 %$2%$3 Exec $0 Then you just need to CondAdd /usr/bin/mozilla Programs mozilla.xpm Mozilla CondAdd /usr/bin/netscape Programs netscape.xpm Netscape CondAdd /usr/X11R6/bin/xterm Programs xterm.xpm Terminal ... to add applications to Programs menu if they exist... doesnt look so untidy :) -- ------------------------------------- [EMAIL PROTECTED] | finger me for my gpg key. -------------------------------------------------------
pgp00000.pgp
Description: PGP signature
