2 # Generates an FVWM menu for selecting the PNG images found in a given
3 # directory. Thumbnails for the images are generated on the fly using convert
4 # from ImageMagick, and stored in the .thumbs subdirectory. The menu items
5 # run the specified function with the filename as the first argument.
9 thumber="$FVWM_USERDIR/scripts/thumbnail.zsh"
11 if [ ! -d "$1" ]; then
12 echo "usage: $0 <directory> [menuname]" 1>&2
15 [ -n "$2" ] && menu="$2"
17 for i in "$1"/*$($FVWM_USERDIR/scripts/C/xaspect).png; do
18 thumb="`$thumber --size x160 "$i"`"
19 echo "AddToMenu $menu \"`basename "${i%.png}"`*$thumb*\" $func \"$i\""