CUPS has always had a configurable set of "Default Options" for a print queue.
system-config-printer also enables editing these.
But applications (see below) seem to completely ignore these! I'm sure (I've been using Debian/Ubuntu for 10 years) they didn't use to ignore them.
Is there some issue somewhere? Or a configuration option I've got wrong somewhere? Or a fix/workaround?
I've noticed that if I create a new user, the defaults are there. So there must be a user setting somewhere – But where?!
Specifics
I know there's no point asking a question like this without specifics, so here you go:
-
applications which disrespect defaults: Firefox, DigiKam, EOG ("Image Viewer"), LibreOffice 3, Thunderbird, Evince ("Document Viewer"). I haven't found a single application that does respect the defaults.
-
Environment: Ubuntu 12.04 LTS with Gnome Shell.
-
Printer driver (stock, from Ubuntu): "HP Photosmart 7510 Series, hpcups 3.12.2"
-
A specific example is that the default options say: duplex, "best" quality, "plain paper", but the apps all default to non-duplex, "high resolution photo" quality, "photo paper". This means it takes 10 minues per sheet, and costs a fortune in ink!
Best Answer
Summary: you're probably seeing the options for the last instance in
~/.cups/lpoptions
.There are both system-wide defaults and per-user defaults.
The
system-config-printer
application and the CUPS web interface configure system-wide defaults. These are stored in/etc/cups/printers.conf
and/etc/cups/ppd/NAME.ppd
where NAME is the name of the printer. In a.ppd
file, an option setting line looks like this:The possible values for this option, which is called
Duplex
, are given by lines likeThe part after the colon describes the commands to send to the printer to activate the setting. The part before the colon consists of a
*
, then the name of the option, then a space, then one or more names for the value separated by slashes (for example, “None” and “Off” mean the same thing for this particular option, you can use them interchangeably).You can also have per-user defaults stored in a file called
.cups/lpoptions
in your home directory. The syntax of this file looks like this:A line like
Dest lj/single …
defines an instance calledsingle
of the printer calledlj
. When printing to that instance, theDuplex
option is set toNone
. When printing to the default instance, theDuplex
option is set toDuplexNoTumble
(i.e. double-sided). The lineDefault lj …
defines default options when printing tolj
. These options override the system-wide defaults. The use ofDefault
rather thanDest
makeslj
the default printing destination.(You can also have a system-wide
/etc/cups/lpoptions
. Why have a system-wide file, which might seem redundant with the options set in the.ppd
file? The difference is that if your computer acts as a print server from other computers, the.ppd
file applies to all, whereas/etc/cups/lpoptions
only applies when printing from the local computer.)You can use instances to make different sets of options available under a nickname from the command line. For example, with the
lpoptions
file above,lp -d lj
prints double-sided andlp -d lj/single
prints single-sided. Instances are also visible in some GUIs, for example in the KDE print dialog.The Gnome print dialog does not show different instances, you only get one. However, rather counter-intuitively, Gnome doesn't default to the options for plain
lp
, but instead picks the last instance that was mentioned in thelpoptions
file. So for example, with thelpoptions
file above, the default is duplex printing, but if the two lines were swapped, the default would be single-sided.Another trap with Gnome is that it also reads the file
~/.lpoptions
. This is an old location for~/.cups/lpoptions
, which the printing system doesn't read anymore since Ubuntu 12.04 or thereabouts, but which Gnome still reads as of Ubuntu 14.04. If you have one, rename it to.cups/lpoptions
or delete it.