Skip to content

Instantly share code, notes, and snippets.

@n8felton
Last active March 16, 2020 19:22
Show Gist options
  • Save n8felton/8b1d90fc5d77ae040fd3bd25ab95f88e to your computer and use it in GitHub Desktop.
Save n8felton/8b1d90fc5d77ae040fd3bd25ab95f88e to your computer and use it in GitHub Desktop.
Small snippet to extract printer icons from macOS printer drivers
MODEL="Xerox WorkCentre 6655"
ICON=$(gunzip -c "/Library/Printers/PPDs/Contents/Resources/${MODEL}.gz" | awk '/APPrinterIconPath/ {gsub(/"/,"",$2); print $2}')
/usr/bin/sips -s format png "${ICON}" --out "${MODEL}.png" --addIcon --resampleHeightWidthMax 512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment