| 
									
										
										
										
											2024-08-03 22:20:05 +03:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-04 14:26:10 +03:00
										 |  |  | if ! command -v magick &> /dev/null; then | 
					
						
							|  |  |  |   echo "This tool requires ImageMagick to be installed in order to create the icons." | 
					
						
							|  |  |  |   exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-04 15:36:51 +03:00
										 |  |  | if ! command -v inkscape &> /dev/null; then | 
					
						
							|  |  |  |   echo "This tool requires Inkscape to be render sharper SVGs than ImageMagick." | 
					
						
							|  |  |  |   exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-04 14:26:10 +03:00
										 |  |  | if ! command -v icnsutil &> /dev/null; then | 
					
						
							|  |  |  |   echo "This tool requires icnsutil to be installed in order to generate macOS icons." | 
					
						
							|  |  |  |   exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-03 22:20:05 +03:00
										 |  |  | script_dir=$(realpath $(dirname $0)) | 
					
						
							|  |  |  | cd "${script_dir}/../images/app-icons" | 
					
						
							| 
									
										
										
										
											2024-08-04 15:36:51 +03:00
										 |  |  | inkscape -w 180 -h 180 "../icon-color.svg" -o "./ios/apple-touch-icon.png" | 
					
						
							| 
									
										
										
										
											2024-08-03 22:20:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Build PNGs | 
					
						
							| 
									
										
										
										
											2024-08-04 15:36:51 +03:00
										 |  |  | inkscape -w 128 -h 128 "../icon-color.svg" -o "./png/128x128.png" | 
					
						
							|  |  |  | inkscape -w 256 -h 256 "../icon-color.svg" -o "./png/256x256.png" | 
					
						
							| 
									
										
										
										
											2025-02-01 11:34:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Build dev icons (including tray) | 
					
						
							|  |  |  | inkscape -w 16 -h 16 "../icon-purple.svg" -o "./png/16x16-dev.png" | 
					
						
							|  |  |  | inkscape -w 32 -h 32 "../icon-purple.svg" -o "./png/32x32-dev.png" | 
					
						
							| 
									
										
										
										
											2024-08-04 15:36:51 +03:00
										 |  |  | inkscape -w 256 -h 256 "../icon-purple.svg" -o "./png/256x256-dev.png" | 
					
						
							| 
									
										
										
										
											2024-08-03 22:20:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Build Mac .icns | 
					
						
							| 
									
										
										
										
											2024-08-04 15:36:51 +03:00
										 |  |  | declare -a sizes=("16" "32" "512" "1024") | 
					
						
							| 
									
										
										
										
											2024-08-04 14:30:55 +03:00
										 |  |  | for size in "${sizes[@]}"; do | 
					
						
							| 
									
										
										
										
											2024-08-04 16:42:35 +03:00
										 |  |  |   inkscape -w $size -h $size "../icon-color.svg" -o "./png/${size}x${size}.png" | 
					
						
							| 
									
										
										
										
											2024-08-04 14:30:55 +03:00
										 |  |  | done | 
					
						
							| 
									
										
										
										
											2024-08-04 16:42:35 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | mkdir -p fakeapp.app | 
					
						
							| 
									
										
										
										
											2024-08-04 17:11:46 +03:00
										 |  |  | npx iconsur set fakeapp.app -l -i "png/1024x1024.png" -o "mac/1024x1024.png" -s 0.8 | 
					
						
							| 
									
										
										
										
											2024-08-04 16:42:35 +03:00
										 |  |  | declare -a sizes=("16x16" "32x32" "128x128" "512x512") | 
					
						
							|  |  |  | for size in "${sizes[@]}"; do | 
					
						
							|  |  |  |   magick "mac/1024x1024.png" -resize "${size}" "mac/${size}.png" | 
					
						
							|  |  |  | done | 
					
						
							|  |  |  | icnsutil compose -f "mac/icon.icns" ./mac/*.png | 
					
						
							| 
									
										
										
										
											2024-08-03 22:20:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Build Windows icon | 
					
						
							| 
									
										
										
										
											2024-08-05 18:47:57 +02:00
										 |  |  | magick -background none "../icon-color.svg" -define icon:auto-resize=16,32,48,64,128,256 "./icon.ico" | 
					
						
							| 
									
										
										
										
											2024-08-03 22:25:10 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-01 14:36:55 +02:00
										 |  |  | # Build Windows setup icon | 
					
						
							|  |  |  | magick -background none "../icon-installer.svg" -define icon:auto-resize=16,32,48,64,128,256 "./win/setup.ico" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-03 22:25:10 +03:00
										 |  |  | # Build Squirrel splash image | 
					
						
							|  |  |  | magick "./png/256x256.png" -background "#ffffff" -gravity center -extent 640x480 "./win/setup-banner.gif" |