#!/usr/bin/perl
#
# start xjig with a random image from /usr/lib/games/xjig/*
# or other directories
#
# Dave Holland <dave@zenda.demon.co.uk> 22 June 1999

srand;

@list = split(' ',`/bin/ls /usr/lib/games/xjig/* /usr/local/lib/games/xjig/* ~/.xjig/*`);

$index = rand @list;
chomp($file = $list[$index]);

exec "/usr/games/xjig",@ARGV,"-file","$file" || die "Couldn't start xjig: $!\n";
