Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!snorkelwacker!usc!zaphod.mps.ohio-state.edu!mips!sgi!shinobu!odin!ramoth.esd.sgi.com!msc From: msc@ramoth.esd.sgi.com (Mark Callow) Newsgroups: comp.sys.sgi Subject: Re: backgrnd proc to dump whole/partial screen to file Message-ID: <9938@odin.corp.sgi.com> Date: 3 Jul 90 21:46:30 GMT References: <9007021722.aa01256@VGR.BRL.MIL> Sender: news@odin.corp.sgi.com Reply-To: msc@sgi.com Organization: Silicon Graphics Inc., Entry Systems Division Lines: 70 In article <9007021722.aa01256@VGR.BRL.MIL>, pmorris@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@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."