Last active
March 16, 2020 19:22
-
-
Save n8felton/8b1d90fc5d77ae040fd3bd25ab95f88e to your computer and use it in GitHub Desktop.
Small snippet to extract printer icons from macOS printer drivers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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