backgrnd proc to dump whole/partial screen to file
Mark Callow
msc at ramoth.esd.sgi.com
Wed Jul 4 07:46:30 AEST 1990
In article <9007021722.aa01256 at VGR.BRL.MIL>, pmorris at BBN.COM (phil
morris) writes:
|> Hi,
|>
|> I'm wondering if there is a way to write a background process that can
|> monitor for some key seq (signal?) that would then take over the display
|> and allow the user to rubberband an area of the screen to dump to a file
|> as either a bit-map or a postscript file. Anyone know how to do this
|> or has already done it?
Here is a shell archive containing 2 files sp and sp.kill. sp installs a
lightweight PostScript process that watches the print screen key. When the
print screen key is pressed, sp invokes the scrsave program. You can change
"scrsave /usr/tmp/scrsave" to "snapshot" if you want to rubberband out the
area to be saved. sp.kill removes the lightweight process.
Both files should be made executable.
# This is a shell archive. Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by on Tue Jul 3 14:41:40 PDT 1990
# Contents: sp sp.kill
echo x - sp
sed 's/^@//' > "sp" <<'@//E*O*F sp//'
#!/usr/NeWS/bin/psh
systemdict begin
/ScreenPrinter {
newprocessgroup
createevent begin
/Name 16#6F9E def % PrintScreen key scan code
/Action [/UpTransition /DownTransition] def
/Exclusivity true def
currentdict
end expressinterest
{
awaitevent begin
Action /UpTransition eq {
console rand (Saving screen %\n) fprintf
(scrsave /usr/tmp/scrsave) forkunix
} if
end
} loop
} fork def
end
@//E*O*F sp//
chmod u=rwx,g=rx,o=rx sp
echo x - sp.kill
sed 's/^@//' > "sp.kill" <<'@//E*O*F sp.kill//'
#!/usr/NeWS/bin/psh
systemdict /ScreenPrinter known {
ScreenPrinter killprocess
systemdict /ScreenPrinter undef
} if
@//E*O*F sp.kill//
chmod u=rwx,g=rx,o=rx sp.kill
exit 0
--
>From the TARDIS of Mark Callow
msc at ramoth.sgi.com, ...{ames,decwrl}!sgi!msc
"There is much virtue in a window. It is to a human being as a frame is to
a painting, as a proscenium to a play. It strongly defines its content."
More information about the Comp.sys.sgi
mailing list