File: makeMacIcon.sh

package info (click to toggle)
open3d 0.19.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,496 kB
  • sloc: cpp: 206,543; python: 27,254; ansic: 8,356; javascript: 1,883; sh: 1,527; makefile: 259; xml: 69
file content (32 lines) | stat: -rwxr-xr-x 1,127 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

if [[ $# < 1 ]]; then
    echo "Usage: $1 icon.svg"
    exit 1 
fi

svg=$1
filename=`basename "$svg"`
name=${filename%.*}
tmpdir="/tmp/${name}.iconset"
icnsfile="$name.icns"

rm -rf "$tmpdir"
mkdir -p "$tmpdir"

inkscape --export-png="$tmpdir/icon_512x512@2x.png" --export-width=1024 "$svg"
inkscape --export-png="$tmpdir/icon_512x512.png" --export-width=512 "$svg"
inkscape --export-png="$tmpdir/icon_256x256@2x.png" --export-width=512 "$svg"
inkscape --export-png="$tmpdir/icon_256x256.png" --export-width=256 "$svg"
inkscape --export-png="$tmpdir/icon_128x128@2x.png" --export-width=256 "$svg"
inkscape --export-png="$tmpdir/icon_128x128.png" --export-width=128 "$svg"
inkscape --export-png="$tmpdir/icon_32x32@2x.png" --export-width=64 "$svg"
inkscape --export-png="$tmpdir/icon_32x32.png" --export-width=32 "$svg"
inkscape --export-png="$tmpdir/icon_16x16@2x.png" --export-width=32 "$svg"
inkscape --export-png="$tmpdir/icon_16x16.png" --export-width=16 "$svg"

iconutil -c icns --output "$icnsfile" "$tmpdir"
rm -rf "$tmpdir"

# Inkscape is so chatty that we should output something
echo "Created $icnsfile"