X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fvidwhacker;h=5d9fe9cd1592bda5623a10c5408445aa8cdc9a11;hb=0316d74da7982288abddd34e7a62698eb7f79965;hp=45175a921ba88c96f36e7e753dad6d2073dcff19;hpb=5832fe184606766fef23369159306c0a5799aeb0;p=xscreensaver diff --git a/hacks/vidwhacker b/hacks/vidwhacker index 45175a92..5d9fe9cd 100755 --- a/hacks/vidwhacker +++ b/hacks/vidwhacker @@ -12,9 +12,9 @@ # # # This script grabs a frame of video, then uses various pbm filters to -# munge the image in random nefarious ways, then uses xli or xv to put it -# on the root window. This works out really nicely if you just feed some -# random TV station into it... +# munge the image in random nefarious ways, then uses xloadimage, xli, or xv +# to put it on the root window. This works out really nicely if you just +# feed some random TV station into it... # # The video grabbing part is SGI-specific -- if you want to use this on # another system, add a new clause to the grab() procedure. @@ -42,30 +42,37 @@ tmp_ppm4=$tmp-4.ppm tmp_ppmS=$tmp-S.ppm -# Figure out whether to use xli or xv. +# Figure out whether to use xloadimage, xli, or xv. pick_displayer() { - IFS=: - for p in $PATH; do - if [ "$p" = "" ]; then p=. ; fi - if [ -x $p/xli ]; then - displayer=$p/xli - displayer_args="-quiet" - displayer_win_args="" - displayer_root_args="-onroot -center -border black" - return - elif [ -x $p/xv ]; then - displayer=$p/xv - displayer_args="-quick24" - displayer_win_args="-geom +0+0" - displayer_root_args="-root -rmode 5 -noresetroot -rfg black -rbg black -viewonly" - - return - fi + displayer= + for prog in xloadimage xli xv ; do + IFS=: + for p in $PATH; do + IFS= + if [ "$p" = "" ]; then p=. ; fi + if [ -x $p/$prog ]; then + displayer=$prog + break 2 + fi + done done - IFS= - echo "$0: neither xli nor xv found on \$PATH" - exit -1 + if [ "$displayer" = "xloadimage" ]; then + displayer_args="-quiet" + displayer_win_args="" + displayer_root_args="-onroot" + elif [ "$displayer" = "xli" ]; then + displayer_args="-quiet" + displayer_win_args="" + displayer_root_args="-onroot -center -border black" + elif [ "$displayer" = "xv" ]; then + displayer_args="-quick24" + displayer_win_args="-geom +0+0" + displayer_root_args="-root -rmode 5 -noresetroot -rfg black -rbg black -viewonly" + else + echo "$0: neither xli nor xv found on \$PATH" + exit -1 + fi } # Process command-line args @@ -169,6 +176,11 @@ grab() { # streamer -o $tmp_ppm1 # + # James Isaacs says this works for the ATI video capture card: + # + # atitv snap $tmp_ppm1 + # + else echo "$0: don't know how to grab video on this OS." >&2 clean2