Giter Club home page Giter Club logo

airprint-ppd's Introduction

airprint-ppd.zsh

This script generates a PPD for AirPrint capable printers. It is based on the work of Kevin M. Cox and Apizz and solves the problem with missing Printer icons when working in root context.

It will fetch all printer icon files from the printer via HTTP and will then try to build an iconset, which will then be converted to a icns file and stored to /Library/Printers/Icons with a predefined name.

Usage

This script queries the given printer url for a PPD and handles the icon generation, so that it may be run as root. A printer icon will be generated and saved to the default location with the expected name containing the printers UUID. You may optionally save a copy of the icons file to a different location.

airprint-ppd.zsh -p printer_url [-i icns_copy_dir] [-o ppd_output_dir] [-n name] [-s]

Parameters

  • -p printer_url: IPP URL, for example ipp://FNCYPRNTR.local or ipp://192.168.1.244:443 (mandatory)
  • -i icns_copy_dir: Output directory to copy the printer icon to, required if not running with root privileges
  • -o ppd_output_dir: Output dir for PPD, required if not running with root privileges. For root user this defaults to /Library/Printers/PPDs/Contents/Resources
  • -n name: Name to be used for icon and ppd file, defaults to queried model name
  • -s: Switch to secure mode, which won't ignore untrusted TLS certificates
  • -h: Show usage message

So, when running this script without root privileges, you are required to specify all three parameters. Running as root enables you to use the default directories for the printer icon and the PPD file.

System Requirements

This script was tested with macOS 10.15 Catalina and macOS 11 Big Sur. It should work with macOS 10.14 Mojave, but this is not verified.

It uses only default system components and (hopefully) no third party tools.

We have successfully worked with different make and models, but there may be some printers who react unexpectedly to our requests โ€“ so please test this script and provide some feedback when you encounter any problems.

Caveats

Some printers have disabled unencrypted IPP traffic but do not present a trusted TLS certificate. To properly download the needed icon images anyway, we are running the curl command with the insecure option by default. So please, query trusted IPP addresses, only. You may use the -s option to force the certificate validation.

airprint-ppd's People

Contributors

insyria avatar choules avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.