printer set up script

Jude DaShiell jdashiel at shellworld.net
Fri May 28 09:40:47 UTC 2010


This isn't the best script since it assumes cups and doesn't check for any 
other printer utilities like apsgen that would be on a linux box and 
doesn't check for any of the utilities it uses.  It also assumes Panasonic 
KX-P1123 printer which won't be the case for most users.  A slightly 
better script would ask the user and try to add that printer's ppd file or 
a really good script would query the printer for manufacturer and model 
then do the addition of the right ppd file or exit if no ppd file would be 
correct even up on linuxprinter.com.  All that being said, provided you 
know the exact name of your printer a little editing could make this 
useful for you too.
#!/bin/bash
# file: pset.sh - printer configuration script
echo "setting up printer queue->"
lpadmin -p Panasonic-KX-P1123 -E -v parallel:/dev/lp0 -m Panasonic-KX-P1123-epson.ppd
lpstat -p
echo "adjust cups to print in United States"
lpoptions -d Panasonic-KX-P1123 -o PageSize=Letter
lpoptions -d Panasonic-KX-P1123 -o PageRegion=Letter
lpoptions -d Panasonic-KX-P1123 -o Resolution=180X180DPI
echo "show printer option settings then exit->"
lpoptions -d Panasonic-KX-P1123 -l




More information about the Blinux-list mailing list