source: trunk/misc/build_helpers/icons/make-osx-icon.sh

Last change on this file was 96d2614, checked in by Daira Hopwood <daira@…>, at 2015-04-30T14:24:20Z

fix OS X logo generation

  • Property mode set to 100755
File size: 928 bytes
Line 
1#! /bin/bash
2# Based on <http://stackoverflow.com/a/23688878/393146> and
3# <http://stackoverflow.com/a/11788723/393146>.
4# converts the passed-in svgs to icns format
5
6if [[ "$#" -eq 0 ]]; then
7    echo "Usage: $0 svg1 [svg2 [...]]"
8    exit 0
9fi
10
11temp="$(pwd)/temp"
12declare -a res=(16 32 64 128 256 512 1024)
13for f in "$*"; do
14    name="`basename -s .svg "$f"`"
15    iconset="$temp/${name}.iconset"
16    mkdir -p "$iconset"
17    for r in "${res[@]}"; do
18        inkscape -z -e "$iconset/icon_${r}x${r}.png" -w "$r" -h "$r" "$f"
19    done
20    ln "$iconset/icon_32x32.png" "$iconset/icon_16x16@2x.png"
21    mv "$iconset/icon_64x64.png" "$iconset/icon_32x32@2x.png"
22    ln "$iconset/icon_256x256.png" "$iconset/icon_128x128@2x.png"
23    ln "$iconset/icon_512x512.png" "$iconset/icon_256x256@2x.png"
24    mv "$iconset/icon_1024x1024.png" "$iconset/icon_512x512@2x.png"
25    iconutil -c icns -o "${name}.icns" "$iconset"
26done
27rm -rf "$temp"
Note: See TracBrowser for help on using the repository browser.