Re: FVWM: Conditionally adding menu items

From: Tavis Ormandy <taviso_at_sdf.lonestar.org>
Date: Fri, 26 Mar 2004 09:33:36 +0000

--On Friday, March 26, 2004 09:41:53 +0100 Uwe Pross
<keinFruehstuecksfleisch_at_gmx.net> 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 :)


-- 
-------------------------------------
taviso_at_sdf.lonestar.org | finger me for my gpg key.
-------------------------------------------------------



--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri Mar 26 2004 - 03:36:04 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST