#!/bin/sh
#
floppy=/usr/lib/X11/sx/sxfloppy
sxmenu=/usr/bin/X11/sxmenu
geometry=

while true
do
	if [ "$1" = "" ]
	then
		break
	elif [ $1 = -geometry ]
	then
		geometry=$2
		shift
	elif [ $1 = -floppyPath ]
	then
		floppy=$2
		shift
	elif [ $1 = -sxmenuPath ]
	then
		sxmenu=$2
		shift
	fi
	shift
done
if [ ! -d $floppy ]
then
	echo "No directory for sxfloppy : $floppy"
	echo "usage: sxfloppy [-floppyPath path] [-sxmenuPath path]"
	exit 1
fi
if [ "$geometry" = "" ]
then
	exec $sxmenu -file $floppy/menu.ascii/main -popupName floppy -varFile /etc/rc.custom -name 'Floppy_Format/Copy' FloppyHome=$floppy 
else
	exec $sxmenu -geometry $geometry -file $floppy/menu.ascii/main -popupName floppy -varFile /etc/rc.custom -name 'Floppy_Format/Copy' FloppyHome=$floppy 
fi
