forked from amahi/ios
-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate-iconset
executable file
·82 lines (54 loc) · 2.17 KB
/
generate-iconset
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# requires icon to be in icon/ as a .png file
generate_iconset(){
local full_icon="$1"
local dest="set"
mkdir -p "$dest" && pushd "$dest" &> /dev/null
cp "$full_icon" Icon-20.png &> /dev/null
sips -z 20 20 Icon-20.png &> /dev/null
cp "$full_icon" Icon-29.png &> /dev/null
sips -z 29 29 Icon-29.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 40 40 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 58 58 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 60 60 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 87 87 [email protected] &> /dev/null
cp "$full_icon" Icon-50.png &> /dev/null
sips -z 50 50 Icon-50.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 100 100 [email protected] &> /dev/null
cp "$full_icon" Icon-57.png &> /dev/null
sips -z 57 57 Icon-57.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 114 114 [email protected] &> /dev/null
cp "$full_icon" Icon-40.png &> /dev/null
sips -z 40 40 Icon-40.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 80 80 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 120 120 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 120 120 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 180 180 [email protected] &> /dev/null
cp "$full_icon" Icon-72.png &> /dev/null
sips -z 72 72 Icon-72.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 144 144 [email protected] &> /dev/null
cp "$full_icon" Icon-76.png &> /dev/null
sips -z 76 76 Icon-76.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 152 152 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 167 167 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 1024 1024 [email protected] &> /dev/null
echo "Icon set is in: $PWD"
popd &> /dev/null
}
for file in $PWD/icon/*.{png,PNG}; do
[ -e "$file" ] && generate_iconset "$file" && break
done