Subject: FVWM: Creating a wallpaper menu

From: "Mark A. Nicolosi" <[email-masked]>
Date: Fri, 3 Jan 2003 01:05:11 -0600

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
+ 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'
+ 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!

-- 
Mark A. Nicolosi <markan_at_penguinmail.com>
--
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-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 3 Jan 2003 08:56:39 +0000

> + 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 WallpaperMe…

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.

> 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.

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 7 Jan 2003 06:29:54 +0100

> able to decipher that mess :) I'd appreciate the help. Thanks!

I have a setup in my config file that dynamically generates a menu
with backrounds, including thumbnails.  The selected background is
remembered over a restart.  It expects to find the images in
$HOME/.fvwm/backgrounds/ and stores the last selected background
in the file $HOME/.fvwm/background.  The backgrounds must be named

  <somename>.bg.<extension>

e.g.

  marble.bg.jpg

and must be in a format understood by xv, which is used to set the
backgorund.  The thumbnails that are used in the menu must be in
xpm format and be named

  <somename>.thumb.xpm

e.g.

  marble.thumb.xpm

(with the same name as the big image, of course)

Bye

Dominik ^_^  ^_^

---

From: "Mark A. Nicolosi" <[email-masked]>
Date: Tue, 7 Jan 2003 14:24:44 -0600

Thanks. I like the idea :) I'm going to modify this to work on
my system.