[Xprint] Xprint configuration oddities
Drew Parsons
dparsons at debian.org
Sun Jul 31 20:47:14 EDT 2005
On Fri, 2005-07-29 at 12:24 +0100, Toby Blake wrote:
> Firstly I'd like to
> have more control over the list of printers Xprint provides.
> So, going by the info in the FAQ, I put the following line in
> /usr/X11R6/lib/X11/xserver/C/print/Xprinters:
>
> Augment_Printer_List /usr/bin/printers |cut -f1
>
> ...and, after restarting Xprt, I look at the list of printers in
> Firefox and find that it seems to have taken the output of
> /usr/bin/printers, but not piped it through 'cut', i.e. printers are
> listed of the form 'name HP4100DTN on 4th Floor'. I can put the line
> '/usr/bin/printers |cut -f1' in a separate script, change Xprinters to
>
> Augment_Printer_List /path/to/one/line/script
>
> ... and it works OK. This is the first oddity.
>
It sounds like Augment_Printer_List is just expecting a single string,
which is why it works when you give it the script. It's only reading up
till the first whitespace. Did you try putting "quotes" around
"/usr/bin/printers |cut -f1" (though my guess is that won't work, it'll
just try to use '"/usr/bin/printers' instead)
> The second one is the ordering of the printer list - our 'printers'
> command sorts the list of printers according to certain criteria, this
> seems to be reversed by Xprint, i.e. our order of
>
> name1
> name2
> name3
>
> ....turns into
>
> name3
> name2
> name1
>
> ... with the xp_[pdf|ps]spooldir printers interspersed at strange
> points in the output (one is second in the list, after my default
> printer and the other is in the place where the default printer would
> have been).
If it's just reversing the normal order, then of course you can add " |
sort -r" or whatever in your script. I think on my system (Debian), the
placement of the spooldir printers is defined
by /usr/share/Xprint/xserver/C/print/Xprinters, where they are given
after the Augment_Printer_List command. I can't answer why its getting
mixed up for you. I think you're right, Xprint expects the client
program to deal with this itself.
>
> While I'm on the subject of the printer list provided by Xprint, is
> there any way of formatting this output in any way? e.g. we have 60+
> printers - I would like to be able to split this list up, so that the
> user sees, say, 4 categories which contain printers, rather than a
> massive list. I realise this is probably a function of the client
> app, but thought it worth checking.
>
I'm not aware of any such facility, sorry. CUPS has a class system, but
that's not quite the same thing anyway, I think.
>
> Also, one other important question on a different matter, how does
> Xprint relate printer names to their models? There is mention in the
> FAQ of family/class but it doesn't describe how to tell Xprint which
> family/class a particular printer belongs to. If I have a list of
> printers specified in the way above, how does Xprint know what model
> each printer is, so we can use model-specific configurations?
>
I think you want to
use /usr/share/Xprint/xserver/C/print/attributes/printer. See the line
*xp-model-identifier: PSdefault
If I read it right, you change it to things like
name1.xp-model-identifier: PSdefault
name2.xp-model-identifier: CANONBJ10E-GS
name3.xp-model-identifier: HPDJ1600C
etc
where the various models are defined
in /usr/share/Xprint/xserver/C/print/models.
Sorry I can't be much more help, I don't run a whole department so the
default settings (Psdefault, autodetect) have been good enough for me!
Drew Parsons
More information about the Xprint
mailing list