-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathcreate_icon.sh
More file actions
executable file
·34 lines (27 loc) · 1.08 KB
/
create_icon.sh
File metadata and controls
executable file
·34 lines (27 loc) · 1.08 KB
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
#!/bin/bash
# Check if source image exists
SOURCE="frontend/public/LumenX.png"
if [ ! -f "$SOURCE" ]; then
echo "Error: $SOURCE not found"
exit 1
fi
echo "Creating icon.icns from $SOURCE..."
# Create a temporary iconset directory
ICONSET="LumenX.iconset"
mkdir -p "$ICONSET"
# Generate icons of different sizes
sips -z 16 16 "$SOURCE" --out "${ICONSET}/icon_16x16.png"
sips -z 32 32 "$SOURCE" --out "${ICONSET}/icon_16x16@2x.png"
sips -z 32 32 "$SOURCE" --out "${ICONSET}/icon_32x32.png"
sips -z 64 64 "$SOURCE" --out "${ICONSET}/icon_32x32@2x.png"
sips -z 128 128 "$SOURCE" --out "${ICONSET}/icon_128x128.png"
sips -z 256 256 "$SOURCE" --out "${ICONSET}/icon_128x128@2x.png"
sips -z 256 256 "$SOURCE" --out "${ICONSET}/icon_256x256.png"
sips -z 512 512 "$SOURCE" --out "${ICONSET}/icon_256x256@2x.png"
sips -z 512 512 "$SOURCE" --out "${ICONSET}/icon_512x512.png"
sips -z 1024 1024 "$SOURCE" --out "${ICONSET}/icon_512x512@2x.png"
# Convert iconset to icns
iconutil -c icns "$ICONSET" -o icon.icns
# Clean up
rm -rf "$ICONSET"
echo "Success! icon.icns created."