macOS-icon-generator
macOS-icon-generator copied to clipboard
Add Support for Command Line Tool to Support Multiple Banner Names, Surpress Unneeded Icons and Control Outputted Icon Name
Hi:
Thanks for creating "macOS-icon-generator" and the built-in command line tool and sharing it with the community.
I would request that the command line tool support adding multiple banner names like...
/path/to/Contents/Resources/icons_cli -i "$INPUT_APP" -o "$BANNER_OUTPUT_DIR" -b "$BANNER_1" "$BANNER_2" "$BANNER_3"
And would like support to suppress unnecessary icons like "uninstall.png" "uninstall_animated.png"
And control the outputted icon name like:
install_[CUSTOM_NAME].png
uninstall_[CUSTOM_NAME].png
uninstall_animated_[CUSTOM_NAME].png
Or
[CUSTOM_NAME]_install.png
[CUSTOM_NAME]_uninstall.png
[CUSTOM_NAME]_uninstall_animated.png
For example, here is a bash script that would give similar functionality using your cli tool...
#!/bin/bash
# Define the path to icons_cli, input application, output directory, and banner types
ICONS_CLI_PATH="/path/to/Icons.app/Contents/Resources/icons_cli"
INPUT_APP="path/to/MyApp.app"
OUTPUT_DIR="path/to/icon_test"
BANNERS=("install" "upgrade" "uninstall")
# Loop through each banner type, create a sub-directory, and generate the icon
for BANNER in "${BANNERS[@]}"; do
# Create the sub-directory for the current banner
BANNER_OUTPUT_DIR="$OUTPUT_DIR/$BANNER"
mkdir -p "$BANNER_OUTPUT_DIR"
# Generate the icon for the current banner
"$ICONS_CLI_PATH" -i "$INPUT_APP" -o "$BANNER_OUTPUT_DIR" -b "$BANNER"
# Remove unnecessary icons
rm -f "$BANNER_OUTPUT_DIR/uninstall.png"
rm -f "$BANNER_OUTPUT_DIR/uninstall_animated.png"
# Rename the generated icon to [BANNER_NAME].png if it's an install banner
if [ -f "$BANNER_OUTPUT_DIR/install.png" ]; then
mv "$BANNER_OUTPUT_DIR/install.png" "$BANNER_OUTPUT_DIR/$BANNER.png"
fi
done
exit $?