Re: FVWM: Broken Dynamic Menus

From: Chris Debenham <chris_at_adebenham.com>
Date: Thu, 20 Jan 2005 09:18:56 +1100

The problem isn't nessecarily with the sed line itself its actually that the line length gets too long. Try shortening it like:
AddToFunc FuncFvwmMenuDirectory
+ I PipeRead 'test -f "$0"/.icontitle.png && mytitle="$0"/.icontitle.png;\
    fvwm-menu-directory -d "$0" --exec-title "^rox" --exec-file "^rox"\
    --icon-dir "folder_blue.png" --icon-title "folder_green.png"\
    --icon-file=__PIXMAP__ | sed\
    -e "s/__PIXMAP__\\(%.*.[mp3|MPG|ogg]\\)/sound.png\\1/g"\
    -e "s/__PIXMAP__\\(%.*.[png|jpg|JPG|jpeg|gif|GIF|bmp]\\)/image.png\\1/g"\
    -e "s/__PIXMAP__\\(%.*.[avi|mpg|AVI|MPG|mpeg|MOV|mov]\\)/video.png\\1/g"'


This worked for me (browsed 8 levels deep)

Chris


On Wed, Jan 19, 2005 at 10:54:19AM -0500, Scott Rubin wrote in a legally binding way:
> Date: Wed, 19 Jan 2005 10:54:19 -0500
> From: Scott Rubin <slr2777_at_cs.rit.edu>
> Organization: RIT
> To: fvwm_at_fvwm.org
> Subject: Re: FVWM: Broken Dynamic Menus
>
> Thanks! I thought it was something to do with the sed line. I'm not the best
> with regular expressions. Also, thanks for the tip on putting that stuff
> into
> another file as a script. I'll do that right away. Now, does anyone see
> what's
> wrong with the sed script? Is there a better way than that to set different
> icons on different files? Using sed feels really hacky.
>
> -Scott
>
> Mikhael Goikhman wrote:
> >On 18 Jan 2005 23:24:58 -0500, Scott Rubin wrote:
> >
> >>Ok, so I have some dynamic menus (FuncFvwmMenuDirectory) I use for
> >>browsing certain directories on my drive. Mostly my documents, movies and
> >>music directories. They worked and still partially do. Recently I
> >>modified my menus a bit and now my dynamic menus only allow me to browse
> >>2 directories deep. It simply wont do anything if I try to browse deeper
> >>than that. My fvwm configuration is available for your viewing pleasure
> >>at http://apreche.net/~apreche/fvwm2rc
> >
> >
> >On the second try, I can reproduce your problem. Your large "sed" line
> >seems buggy, if you remove the pipe to sed, it will work well.
> >
> >Like I suggested in the previous message, don't code unix commands in
> >fvwm config directly (unless you are good in debugging of such things).
> >Instead, create a shell script my-fvwm-menu that gets one parameter
> >(dir name) and does all the work, like setting icons/titles and calling
> >fvwm-menu-directory with correct parameters, and filtering using sed,
> >if needed.
> >
> >Then test this my-fvwm-menu script from the command line, and after you
> >verified it works for all your directories, use it like this:
> >
> > DestroyFunc FuncFvwmMenuDirectory
> > AddToFunc FuncFvwmMenuDirectory
> > + I PipeRead `my-fvwm-menu '$0'`
> >
> >The DestroyFunc line is very important when you debug your config, it
> >ensures you always replace the function (or menu) definition and not
> >unintentionally add to the previous definition.
> >
> >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.

-- 
Santa's Elves Are Just A Bunch Of Subordinate Clauses.
--
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 Wed Jan 19 2005 - 16:20:01 GMT

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