On Fri, Jan 03, 2003 at 01:05:11AM -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
> + 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!

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 ^_^  ^_^
AddToFunc SetBackground
+ I Exec test -r $HOME/.fvwm/background && xv -root +noresetroot -quit -viewonly 
+$HOME/.fvwm/backgrounds/`cat $HOME/.fvwm/background|tr -d "\n"`

AddToFunc SetDefaultBackground
+ I Exec echo -e $$0 > $HOME/.fvwm/background
+ I Function SetBackground

AddToMenu BackgroundMenu DynamicPopupAction Function MakeBackgroundMenu

AddToFunc MakeBackgroundMenu
+ I DestroyMenu recreate BackgroundMenu
+ I Piperead 'echo AddToMenu BackgroundMenu Backgrounds Title'
+ I Piperead 'echo AddToMenu BackgroundMenu \\\"reset to [\`cat $HOME/.fvwm/background 
+| sed -e s/\.bg\..\*$//g -e s:.\*/::g\`]\\\" SetBackground'
+ I + "" Nop
+ I AddToMenu BackgroundMenu
+ I PipeRead 'cd $HOME/.fvwm/backgrounds; /bin/ls *.bg.* | sed -e 
+\"s:\\(.*\\)\\(\\.bg\\..*\\):+ \\\\&\\1%$HOME/.fvwm/backgrounds/\\1.thumb.xpm% 
+Function SetDefaultBackground \\1\\2:\"'

AddToFunc StartFunction
+ I Function SetBackground

Reply via email to