On 03 Jan 2003 01:05:11 -0600, Mark A. Nicolosi wrote:
> 
> I'm trying to create a wallpaper menu. First, in ~/images/wallpaper
> I have a bunch of directories to categorize my wallpaper. The
> menu should have those directories listed in the menu and popup
> submenus which contain the name of the images and then runs
> another function to display the image on the root window. I've
> got this half way figured out. I got menu of directories and...
> well, it'd be easier to explain if I just showed you what I have:
> (I think I may have figured out the most complicated of of getting
> this to _not_ work :)
> 
> DestroyMenu WallpaperMenu
> AddToMenu WallpaperMenu
> + DynamicPopupAction            Function CreateWallpaperMenu
> DestroyFunc CreateWallpaperMenu
> AddToFunc CreateWallpaperMenu
> + I DestroyMenu WallpaperMenu recreate WallpaperMenu

Just contacted the man page, the correct syntax is:

  DestroyMenu recreate WallpaperMenu

> + I PipeRead 'for i in `ls -d /home/mark/images/wallpaper/*/`; do echo 
> AddToMenu WallpaperMenu \\"`basename $i | sed "s/_/ /g"`\\" Popup 
> WallPaperMenu`basename $i` ; echo -e DestroyMenu WallpaperMenu`basename 
> $i`\\nAddToMenu WallpaperMenu`basename $i`\\n+ DynamicPopupAction Function 
> CreateWallpaperMenu2 $i WallpaperMenu`basename $i`; done'

Please don't do this unless you want to spend hours debugging this.
Create a shell script that you may fully test from the command line and
run it using PipeRead.

> + I AddToMenu WallpaperMenu "" Nop
> + I AddToMenu WallpaperMenu "Recreate" Function CreateWallpaperMenu
> 
> DestroyFunc CreateWallpaperMenu2
> AddToFunc CreateWallpaperMenu2
> + I Echo "In CreateWallpaperMenu2"
> + I DestroyMenu $2 recreate $2
> + I PipeRead 'for i in `ls $1`; do echo AddToMenu $2 \\"`basename $i | sed 
> "s/_/ /g"`\\" Exec qiv -z $i
> 
> CreateWallpaperMenu2 never gets called. If anyone can help (and be
> able to decipher that mess :) I'd appreciate the help. Thanks!

I suggest you to use fvwm-menu-directory, see its man page.
This way you don't need to write any code, only supply correct options
and copy/paste one or another example in the man page. Try this:

  DestroyFunc CreateWallpaperMenu
  AddToFunc   CreateWallpaperMenu
  + I PipeRead `fvwm-menu-directory --command-file 'Exec qiv -z %f' --dir $0`

  DestroyMenu MyWallpapers
  AddToMenu   MyWallpapers
  + MissingSubmenuFunction CreateWallpaperMenu
  + "Tiles"     Popup $[HOME]/images/tiles
  + "Pictures"  Popup $[HOME]/images/pictures

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 [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to