#!/bin/sh

#
# Sample:
# bgmenudir /usr/lib/X11/backgrounds/ "xv -root -quit" > backgrounds
#
# then #include backgrounds from your menu file

if [ $# = 1 ]; then
	prog="xv -root -quit"
elif [ $# = 0 ]; then
	echo "Syntax is $0 <directory> <program>"
	echo "Ex.:"
	echo "	$0 ~/pixmaps \"xv -root -quit\""
	exit
else
	prog=$2
fi
 
dir=`pwd`
cd $1
echo "Backgrounds" MENU
d=`pwd`
for i in * ;  do
	echo "	\"$i\" EXEC $prog $d/$i"
done
echo "Backgrounds" END

cd $dir

