Skip to content

Commit ec0aa1e

Browse files
committed
Add new Big Sur-style rectangle icon for macOS
Fixes #1253
1 parent 56ab083 commit ec0aa1e

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

build/icon-macos.svg

+77
Loading

build/icon.icns

29.6 KB
Binary file not shown.

scripts/generate-icon-macos.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
set -e
4+
cd "$(dirname "$0")/.."
5+
6+
if [ "$(uname -s)" != Darwin ]; then
7+
echo "This script only runs on macOS since it needs 'iconutil'"
8+
exit 1
9+
fi
10+
11+
if ! command -v inkscape &> /dev/null; then
12+
echo "Please make sure to have 'inkscape' on your PATH!"
13+
exit 1
14+
fi
15+
16+
input_svg="build/icon-macos.svg"
17+
tmp_dir="$(mktemp -dt zulip-icon)"
18+
output_dir="$tmp_dir.iconset"
19+
output_icns="build/icon.icns"
20+
21+
mv "$tmp_dir" "$output_dir"
22+
23+
trap "rm -rf '$output_dir'" EXIT
24+
25+
echo "==> Generating icons from $input_svg..."
26+
27+
for size in 16 32 64 128 256 512 1024; do
28+
echo "Generating icon of size $size..."
29+
icon_prefix="icon_${size}x${size}"
30+
inkscape -o "$output_dir/$icon_prefix.png" -w $size "$input_svg"
31+
inkscape -o "$output_dir/$icon_prefix@2x.png" -w $((size * 2)) "$input_svg"
32+
done
33+
34+
echo "==> Updating ICNS icons..."
35+
36+
for icns in "${output_icns[@]}"; do
37+
echo "Updating $icns..."
38+
iconutil -c icns -o "$icns" "$output_dir"
39+
done

0 commit comments

Comments
 (0)