Re: FVWM: Conditionally adding menu items

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Fri, 26 Mar 2004 20:18:45 +0000

On 26 Mar 2004 22:49:39 +1100, Scott Smedley wrote:
>
> > 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
>
> This works great!
>
> AddToMenu "Multimedia_at_cd.xpm@" "MuLTiMeDia" Title
> Test (x xine) AddToMenu Multimedia "&XiNe (DVD Player)%xine.xpm%" Exec exec xine
> Test (x xcdroast) AddToMenu Multimedia "XCD&RoaST" Exec xhost + && exec xcdroast
> Test (x gtcd) AddToMenu Multimedia "&CD PLaYeR%cdPlayer.xpm%" Exec exec gtcd
> Test (x dvdrip) AddToMenu Multimedia "&dvd::rip" Exec exec dvdrip

The same thing, just shorter and more readable:

  AddToMenu "Multimedia_at_cd.xpm@" "MuLTiMeDia" Title
  Test (x xine) + "&XiNe (DVD Player)%xine.xpm%" Exec exec xine
  Test (x xcdroast) + "XCD&RoaST" Exec xhost +; xcdroast
  Test (x gtcd) + "&CD PLaYeR%cdPlayer.xpm%" Exec exec gtcd
  Test (x dvdrip) + "&dvd::rip" Exec exec dvdrip

Regards,
Mikhael.
--
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 - 14:21:14 GMT

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