|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#!/bin/sh
# (find-angg "bin/kbrequest")
# (find-fline "/etc/inittab" "kbrequest")
# kb::kbrequest:/home/root/vtutil/vtscreenshot
# telinit q
# (find-es "page" "vcsa2pnm")
# (find-angg "MTA/Makefile")
# (find-angg "MTA/vtutil" "examples_of_usage")
# (find-node "(bash)Conditional Constructs" "[[")
# (find-node "(bash)Shell Parameter Expansion" "`${PARAMETER:-WORD}'")
# (find-es "bash" "var_expansion")
VCSADEV=${VCSADEV:-/dev/vcsa0}
FONT=${FONT:-mathlatin.8}
# echo VCSADEV: $VCSADEV
# echo FONT: $FONT
if [[ -e /tmp/ncaptures ]]; then
N=$(</tmp/ncaptures)
else
N=0
fi
N=$[$N+1]
echo $N > /tmp/ncaptures
cd $(dirname $0)
dllua inc.lua vtutil.lua \
-e 'writefile("/tmp/'$N'.ppm",
vcsatoBIGstr(readfile("'$VCSADEV'"),
loadfont("'$FONT'"),
9,
vcsa_colors
)
)
'
pnmtopng < /tmp/$N.ppm > /tmp/$N.png
rm /tmp/$N.ppm
exit
# 99dec06: but when I tried to use these pngs in netscape I noticed
# that it (netscape 4.5) really really really doesn't like the pngs
# generated by convert (from imagemagick); so, use the ones created by
# pnmtopng for anything serious.