From d588c9ddc78497a7fa2a36aafc9a40b687206e03 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 11 Nov 2020 18:07:53 +0100 Subject: Add icns-millefeuille.sh The Agua system icons I'm using don't include all of the variants required on Mac OS X 10.12 Sierra. The originals have seven sizes (32, 256, 512, and 1024), while the system icons have 10 (16, 32, 64, 128, 256, 512, 1024). Using the seven-size icns didn't work when the file was copied into `CoreTypes.bundle`. When I added additional icns size variants, the replacement did work. This script abstracts the manual work I did to add the appropriate variants to the Agua icons. Other icon sets may not convert in the same way. --- icns-millefeuille.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 icns-millefeuille.sh diff --git a/icns-millefeuille.sh b/icns-millefeuille.sh new file mode 100755 index 0000000..e3319a1 --- /dev/null +++ b/icns-millefeuille.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# icns-millefeuille.sh +# +# Takes an icns file and adds missing @1x and 32px sizes. Creates a new icns +# file based on the input in the current directory. + +EX_USAGE=64 + +if [ $# -ne 1 ]; then + echo >&2 'usage: icns-millefeuille.sh ICNS_FILE' + exit $EX_USAGE +fi + +original_icon="$1" +icon="$(basename "$original_icon")" +iconset="${icon/.icns/.iconset}" + +cp -a "$original_icon" . + +iconutil -c iconset "$icon" + +cd "$iconset" + +cp icon_16x16\@2x.png icon_32x32.png + +sips -Z 512 icon_512x512\@2x.png --out icon_512x512.png +sips -Z 256 icon_256x256\@2x.png --out icon_256x256.png +sips -Z 128 icon_128x128\@2x.png --out icon_128x128.png +sips -Z 64 icon_128x128.png --out icon_32x32\@2x.png +sips -Z 16 icon_16x16\@2x.png --out icon_16x16.png + +cd .. + +iconutil -c icns "$iconset" + +rm -rf "$iconset" -- cgit v1.2.3