#!/bin/sh
#
# sdumpgif - get a screen dump of an X Window application and save to GIF
#
# If WINDOWID env. variable is set, it grabs the window with that ID.
# Otherwise, it waits for the user to click in a window and grabs that.
# Saves the GIF image into your home directory, as sdump.gif, so you need
# to move, copy or rename the file to avoid it being clobbered next time.
#
# You can use this as a temporary or permanent replacement for the sdump
# program that comes with the neuro package. Just call this script sdump,
# and put it in /usr/neuro/bin in place of the script that's there now,
# or put it in another directory that's in your PATH environment variable
# before /usr/neuro/bin, such as /usr/local/bin on many systems.
#

xwd ${WINDOWID+"-id"} $WINDOWID | xwdtopnm | ppmquant 256 | ppmtogif > $HOME/sdump.gif
