Last active
April 29, 2023 16:08
-
-
Save Le0xFF/512230b055fbca173536d1d7175df6b9 to your computer and use it in GitHub Desktop.
Simpler script to convert .PNG to .ICNS in macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SOURCE | |
# https://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil/20703594#20703594 | |
# BETTER VERSIONS | |
# https://github.com/retifrav/generate-iconset | |
# https://gist.github.com/djhaskin987/110e324f0bda182b6db34241da0182a6 | |
# https://gist.github.com/djhaskin987/110e324f0bda182b6db34241da0182a6 | |
# https://gist.github.com/yoannmoinet/051d92d132218dc3ad801f74f6f1536c | |
# USAGE | |
# Put this file and the .PNG image (1024x1024 px) in the same folder, rename it to Icon1024.png and from terminal run: | |
# source SimplerConvertToICNS.src | |
mkdir MyIcon.iconset | |
sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png | |
sips -z 32 32 Icon1024.png --out MyIcon.iconset/[email protected] | |
sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png | |
sips -z 64 64 Icon1024.png --out MyIcon.iconset/[email protected] | |
sips -z 128 128 Icon1024.png --out MyIcon.iconset/icon_128x128.png | |
sips -z 256 256 Icon1024.png --out MyIcon.iconset/[email protected] | |
sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_256x256.png | |
sips -z 512 512 Icon1024.png --out MyIcon.iconset/[email protected] | |
sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_512x512.png | |
cp Icon1024.png MyIcon.iconset/[email protected] | |
iconutil -c icns MyIcon.iconset | |
rm -R MyIcon.iconset | |
# After that: | |
# - Boot into Recovery | |
# - Open Terminal | |
# -- csrutil authenticated-root disable | |
# - Reboot into Recovery | |
# - Open Terminal | |
# -- mount -uw /Volumes/macOS/ | |
# -- mount -uw /Volumes/macOS\ - \ Dati/ /Volumes/macOS/System/Volumes/Data/ | |
# -- mount -t apfs /dev/disk6s2 (Preboot) /Volumes/macOS/System/Volumes/Preboot | |
# -- cd /Volumes/macOS/ | |
# -- rm -rf .VolumeIcon.icns System/Volumes/Data/.VolumeIcon.icns System/Volumes/Preboot/.VolumeIcon.icns | |
# -- cp /Volumes/macOS/Users/leot/Downloads/ICNS/Ventura.icns System/Volumes/Data/.VolumeIcon.icns | |
# -- cp /Volumes/macOS/Users/leot/Downloads/ICNS/Ventura.icns System/Volumes/Preboot/.VolumeIcon.icns | |
# -- ln -s System/Volumes/Data/.VolumeIcon.icns .VolumeIcon.icns | |
# -- csrutil authenticated-root enable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment