#!/bin/bash # requires icon to be in icon/ as a .png file generate_iconset(){ local full_icon="$1" local dest="set" mkdir -p "$dest" && pushd "$dest" &> /dev/null cp "$full_icon" Icon-20.png &> /dev/null sips -z 20 20 Icon-20.png &> /dev/null cp "$full_icon" Icon-29.png &> /dev/null sips -z 29 29 Icon-29.png &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 40 40 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 58 58 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 60 60 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 87 87 [email protected] &> /dev/null cp "$full_icon" Icon-50.png &> /dev/null sips -z 50 50 Icon-50.png &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 100 100 [email protected] &> /dev/null cp "$full_icon" Icon-57.png &> /dev/null sips -z 57 57 Icon-57.png &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 114 114 [email protected] &> /dev/null cp "$full_icon" Icon-40.png &> /dev/null sips -z 40 40 Icon-40.png &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 80 80 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 120 120 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 120 120 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 180 180 [email protected] &> /dev/null cp "$full_icon" Icon-72.png &> /dev/null sips -z 72 72 Icon-72.png &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 144 144 [email protected] &> /dev/null cp "$full_icon" Icon-76.png &> /dev/null sips -z 76 76 Icon-76.png &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 152 152 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 167 167 [email protected] &> /dev/null cp "$full_icon" [email protected] &> /dev/null sips -z 1024 1024 [email protected] &> /dev/null echo "Icon set is in: $PWD" popd &> /dev/null } for file in $PWD/icon/*.{png,PNG}; do [ -e "$file" ] && generate_iconset "$file" && break done