patch-xtoys 788 B

123456789101112131415161718192021222324252627282930
  1. $OpenBSD: patch-xtoys,v 1.3 2010/03/25 22:41:44 jasper Exp $
  2. --- xtoys.orig 2003-06-30 08:36:35.000000000 +0200
  3. +++ xtoys 2004-01-31 19:26:36.000000000 +0100
  4. @@ -1,17 +1,16 @@
  5. -#!/bin/bash
  6. +#!/bin/sh
  7. #
  8. # /usr/bin/X11/xtoys -- puts a random cuddly toy onto desktop
  9. #
  10. # Thanks to Andrew Stribblehill <a.d.stribblehill@dur.ac.uk>
  11. # who supported this script
  12. #
  13. -if [ -d /usr/local/share/xteddy ] ; then
  14. - images=(`ls /usr/share/xteddy` `ls /usr/local/share/xteddy 2> /dev/null`)
  15. -else
  16. - images=(`ls /usr/share/xteddy`)
  17. -fi
  18. +i=0
  19. +for img in `ls !!PREFIX!!/share/xteddy`; do
  20. + images[$i]=$img
  21. + i=`expr $i + 1`
  22. +done
  23. -num=${#images[*]}
  24. -choice=`expr $RANDOM % $num`
  25. +choice=`expr $RANDOM % $i`
  26. -/usr/games/xteddy -F${images[choice]} $*
  27. +!!PREFIX!!/bin/xteddy -F${images[choice]} $*