[H-GEN] Printer Jiggery Pokery

Martin Pool mbp at wistful.humbug.org.au
Thu Oct 29 02:49:04 EST 1998


On Thu, Oct 29, 1998 at 05:04:47PM +1000, Michael Anthon wrote:

> I have a desire to do some strange things with printer devices.  

I hope that's not the old `more than one way to skin a cat' thing.

> What I
> would like to do is to set up a printer device that will pop up an X
> window somewhere (preferably on the X terminal sitting on my desk) and
> show whatever was printed (all nicely formatted of course).  The main
> goal here is to save trees, since I am doing some database report
> generation and I really need to see the output and I am getting a rather
> large pile of scribble paper on my desk.
> 
> It seems to me that gv would probably be the program to use to display
> the print, but I have no idea how to set up a printer device that would
> send it's output to another program.
> 
> Any pointers would be appreciated !!

I wonder if you really mean `device', as in `character device'?
That's probably not the right place to do it: too low level.

lpd has plenty of places to hook in what it calls `filters': I imagine
you could use one of these to send the output to gv.  Somewhere in
/etc/printcap (RTFM) you can specify a script to run when a file's
ready to be printed: that script could pop up a window.  Of course,
you'd have to arrange for it to have the appropriate X permissions to
do so.

You could alternatively just leave the job in the queue and have a
script that checks for new entries and displays them from the spool
directory.

Alternatively, you could just ask the program to send it's output to
`gv' rather than `lpr', assuming it can be reconfigured that way: it
should be possible for most unix-y programs.  You could even put an
lpr replacement in your PATH that catches the file, if it's not
configurable.

Food for thought, I hope.

-- 
Martin Pool

"Oh my god, they killed init!  YOU BASTARDS!"




More information about the General mailing list