Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Big Sur-style rectangle icon for macOS #1265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions build/icon-macos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icon.icns
Binary file not shown.
39 changes: 39 additions & 0 deletions scripts/generate-icon-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

set -e
cd "$(dirname "$0")/.."

if [ "$(uname -s)" != Darwin ]; then
echo "This script only runs on macOS since it needs 'iconutil'"
exit 1
fi

if ! command -v inkscape &> /dev/null; then
echo "Please make sure to have 'inkscape' on your PATH!"
exit 1
fi

input_svg="build/icon-macos.svg"
tmp_dir="$(mktemp -dt zulip-icon)"
output_dir="$tmp_dir.iconset"
output_icns="build/icon.icns"

mv "$tmp_dir" "$output_dir"

trap "rm -rf '$output_dir'" EXIT

echo "==> Generating icons from $input_svg..."

for size in 16 32 64 128 256 512 1024; do
echo "Generating icon of size $size..."
icon_prefix="icon_${size}x${size}"
inkscape -o "$output_dir/$icon_prefix.png" -w $size "$input_svg"
inkscape -o "$output_dir/$icon_prefix@2x.png" -w $((size * 2)) "$input_svg"
done

echo "==> Updating ICNS icons..."

for icns in "${output_icns[@]}"; do
echo "Updating $icns..."
iconutil -c icns -o "$icns" "$output_dir"
done