#!/bin/rc rfork e # Grab a window (or the screen, with -s) and convert it to a # png at a given location, optionally looping. Run with no # arguments for a usage message. src=/dev/window name=$user.$pid flagfmt='s,n name,d delay' args='/targ/dir' if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){ aux/usage exit usage } dir=$1 if (~ $flags 1) src=/dev/screen if (! ~ $#flagn 0) name=$flagn(1) if (~ $#flagd 0) topng $src > $dir^/^$name.png if not while () { topng $src > $dir^/^$name.png sleep $flagd(1) }