#!/usr/pkg/bin/bash
#
# /usr/bin/X11/xtoys -- puts a random cuddly toy onto desktop
#
# Thanks to Andrew Stribblehill <a.d.stribblehill@dur.ac.uk>
# who supported this script
#
if [ -d /usr/pkg/share/xteddy ] ; then
  images=(`ls /usr/pkg/share/xteddy` `ls /usr/pkg/share/xteddy 2> /dev/null`)
else
  images=(`ls /usr/pkg/share/xteddy`)
fi

num=${#images[*]}
choice=`expr $RANDOM % $num`

/usr/pkg/bin/xteddy -F${images[choice]} $*
