forked from PrismLauncher/PrismLauncher
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathgenicons.sh
executable file
·66 lines (53 loc) · 2.61 KB
/
genicons.sh
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
#!/bin/bash
svg2png() {
input_file="$1"
output_file="$2"
width="$3"
height="$4"
inkscape -w "$width" -h "$height" -o "$output_file" "$input_file"
}
if command -v "inkscape" && command -v "icotool" && command -v "oxipng"; then
# Windows ICO
d=$(mktemp -d)
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_16.png" 16 16
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_24.png" 24 24
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_32.png" 32 32
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_48.png" 48 48
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_64.png" 64 64
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_128.png" 128 128
svg2png org.prismlauncher.PrismLauncher.svg "$d/prismlauncher_256.png" 256 256
oxipng --opt max --strip all --alpha --interlace 0 "$d/prismlauncher_"*".png"
rm prismlauncher.ico && icotool -o prismlauncher.ico -c \
"$d/prismlauncher_256.png" \
"$d/prismlauncher_128.png" \
"$d/prismlauncher_64.png" \
"$d/prismlauncher_48.png" \
"$d/prismlauncher_32.png" \
"$d/prismlauncher_24.png" \
"$d/prismlauncher_16.png"
else
echo "ERROR: Windows icons were NOT generated!" >&2
echo "ERROR: requires inkscape, icotool and oxipng in PATH"
fi
if command -v "inkscape" && command -v "iconutil" && command -v "oxipng"; then
# macOS ICNS
d=$(mktemp -d)
d="$d/prismlauncher.iconset"
mkdir -p "$d"
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/icon_16x16.png" 16 16
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/[email protected]" 32 32
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/icon_32x32.png" 32 32
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/[email protected]" 64 64
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/icon_128x128.png" 128 128
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/[email protected]" 256 256
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/icon_256x256.png" 256 256
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/[email protected]" 512 512
svg2png org.prismlauncher.PrismLauncher.bigsur.svg "$d/[email protected]" 1024 1024
oxipng --opt max --strip all --alpha --interlace 0 "$d/icon_"*".png"
iconutil -c icns "$d"
else
echo "ERROR: macOS icons were NOT generated!" >&2
echo "ERROR: requires inkscape, iconutil and oxipng in PATH"
fi
# replace icon in themes
cp -v org.prismlauncher.PrismLauncher.svg "../launcher/resources/multimc/scalable/launcher.svg"