Posted on 02-04-2019 09:29 PM
Hi JN!
I've been tasked to set B+W colour option as default on everyone's computer.
Doing this manually will be...a nightmare...so I'm looking at doing a script that runs and configures the color option via CUPS
I've looked at previous posts on this and came up with this one:
https://www.jamf.com/jamf-nation/discussions/23248/set-default-printer-options-via-cups
It looks like the command after lpadmin -p is the name of the printer driver
So I've browsed to 'library > printers' and can see the print drivers - My only worry is that they look like cosmetic names - names you'd set at print driver setup (system preferences > printers & scanners)
So if I deployed a script that sets default CUPS switches depending on the driver name...I could miss a lot as they're all variations of C5550 (we have Canon imageRunner C5550)
Am I looking in the right place? Thanks!
Posted on 02-05-2019 04:44 AM
@Praisethesun the -p
variable of both lpadmin
and lpoptions
is actually the name of the printer on the system, not the friendly name you see in the System Preferences pane, but the printer name as it is in CUPS. You can see these names if you list the printers on a system with the lpstat -a
command:
I only have the one printer, but the printer name is that first "column" of info, so in this case EPSON_XP_410_Series. If I wanted to see what basic options are set currently: lpoptions -p EPSON_XP_410_Series
would get me that list. If I wanted to see all options that are available to be set: lpoptions -p EPSON_XP_410_Series -l
.
Printer drivers live in /Library/Printers/PPDs/Contents/Resources
and for a Canon IR C5550 that driver is most likely /Library/Printers/PPDs/Contents/Resources/CNMCIRAC5550S2.ppd.gz
.
To add that printer you'd use
lpadmin -p <CUPS name> -E -o printer-is-shared=false -v lpd://<ipaddress> -D "<Friendly Name>" -P "<driver path>"
or something along those lines. For example you might use the following for that C5550:
lpadmin -p Studio_Canon_C5550 -E -o printer-is-shared=false -v lpd://1.1.1.1 -D "Studio Canon C5550" -P "/Library/Printers/PPDs/Contents/Resources/CNMCIRAC5550S2.ppd.gz"
You can either set your options via the lpadmin
command above, or you can use lpadmin -p <cupsname> -o <option>
or lpoptions -p <cupsname> -o <option>
. I do find that there are some options, especially on printers with Fiery RIPs that only work with the lpadmin
command to set options.
We have a lot of Canon printers, and for the most part the BW flag is set with the CNColorMode
option, so this line should do that:
lpadmin -p Studio_Canon_C5550 -o CNColorMode=mono
But test the heck out of that.
I have these topics written up on my blog and an example Add Printer script on GitHub:
Using lpoptions To Identify Printer Options
Hope that helps!