Skip to content

Commit d4fdd33

Browse files
committed
fix icns app icon
Signed-off-by: kernelkind <[email protected]>
1 parent 15916d5 commit d4fdd33

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

assets/app_icon.icns

-158 KB
Binary file not shown.

scripts/svg_to_icns.sh

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# Exit on error
4+
set -e
5+
6+
# Check dependencies
7+
if ! command -v inkscape &> /dev/null; then
8+
echo "Error: Inkscape is required but not installed. Install it and try again."
9+
exit 1
10+
fi
11+
12+
if ! command -v iconutil &> /dev/null; then
13+
echo "Error: iconutil is required but not installed. This tool is available only on macOS."
14+
exit 1
15+
fi
16+
17+
# Check input arguments
18+
if [ "$#" -ne 2 ]; then
19+
echo "Usage: $0 input.svg output.icns"
20+
exit 1
21+
fi
22+
23+
INPUT_SVG=$1
24+
OUTPUT_ICNS=$2
25+
TEMP_DIR=$(mktemp -d)
26+
27+
# Create the iconset directory
28+
ICONSET_DIR="$TEMP_DIR/icon.iconset"
29+
mkdir "$ICONSET_DIR"
30+
31+
# Define sizes and export PNGs
32+
SIZES=(
33+
"16 icon_16x16.png"
34+
35+
"32 icon_32x32.png"
36+
37+
"128 icon_128x128.png"
38+
39+
"256 icon_256x256.png"
40+
41+
"512 icon_512x512.png"
42+
43+
)
44+
45+
echo "Converting SVG to PNGs..."
46+
for size_entry in "${SIZES[@]}"; do
47+
size=${size_entry%% *}
48+
filename=${size_entry#* }
49+
inkscape -w $size -h $size "$INPUT_SVG" -o "$ICONSET_DIR/$filename"
50+
done
51+
52+
# Convert to ICNS
53+
echo "Generating ICNS file..."
54+
iconutil -c icns -o "$OUTPUT_ICNS" "$ICONSET_DIR"
55+
56+
# Clean up
57+
rm -rf "$TEMP_DIR"
58+
59+
echo "Done! ICNS file saved to $OUTPUT_ICNS"

0 commit comments

Comments
 (0)