diff options
author | Teddy Wing | 2020-11-11 18:07:53 +0100 |
---|---|---|
committer | Teddy Wing | 2020-11-11 19:14:58 +0100 |
commit | d588c9ddc78497a7fa2a36aafc9a40b687206e03 (patch) | |
tree | 2cca8cb032ca07efbff4dc40b2db69dabb0a7f77 | |
parent | c015b2cd236e687915ce7e1b89e6aa0fcba0db62 (diff) | |
download | macosx-replace-system-icons-d588c9ddc78497a7fa2a36aafc9a40b687206e03.tar.bz2 |
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.
-rwxr-xr-x | icns-millefeuille.sh | 37 |
1 files changed, 37 insertions, 0 deletions
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" |