24 lines
581 B
Bash
Executable File
24 lines
581 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
SOURCE="${1:?Usage: ./scripts/generate-wearos-icon.sh <source-image>}"
|
|
RES_DIR="targets/wearos/app/src/main/res"
|
|
|
|
if [ ! -f "$SOURCE" ]; then
|
|
echo "Error: Source image not found: $SOURCE"
|
|
exit 1
|
|
fi
|
|
|
|
SIZES=("48:mdpi" "72:hdpi" "96:xhdpi" "144:xxhdpi" "192:xxxhdpi")
|
|
|
|
for entry in "${SIZES[@]}"; do
|
|
SIZE="${entry%%:*}"
|
|
DENSITY="${entry##*:}"
|
|
DIR="$RES_DIR/mipmap-$DENSITY"
|
|
mkdir -p "$DIR"
|
|
sips -z "$SIZE" "$SIZE" --out "$DIR/ic_launcher.png" "$SOURCE" > /dev/null
|
|
echo "Created mipmap-$DENSITY/ic_launcher.png (${SIZE}x${SIZE})"
|
|
done
|
|
|
|
echo "Done"
|