Scroll to navigation System Administration

NAME - create Avahi service files for shared CUPS printers

SYNOPSIS [options]


This script will connect to a CUPS server and, for each printer configured and marked as shared, it will generate a .service file for Avahi that is compatible with Apple's AirPrint announcements. Any printer that can be configured to work with CUPS can be used. Printers should not be configured in CUPS as raw, unless the printer can natively print PDF; that is, CUPS needs to already be configured with a PDF filter.


show this help message and exit
Hostname of CUPS server
Port number of CUPS server
Username to authenticate with against CUPS
Directory in which service files are created
Print debugging information to STDERR
Prefix all files with this string


DNSSD has a limit of 255 characters for a given txt-record; because of this, the list of accepted PDLs will be truncated to fit. If you're curious to see which ones are trimmed out of the list, run the script with the verbose flag.

If python-lxml is installed, .service files will be generated in a human readble format (I wasn't able to get minidom's version to work acceptably).


Timothy J. Fontaine <> wrote the script.

January 2016 cups-airprint