generalbots/botdevice/scripts/generate-icons.sh
Rodrigo Rodriguez (Pragmatismo) 037db5c381 feat: Major workspace reorganization and documentation update
- Add comprehensive documentation in botbook/ with 12 chapters
- Add botapp/ Tauri desktop application
- Add botdevice/ IoT device support
- Add botlib/ shared library crate
- Add botmodels/ Python ML models service
- Add botplugin/ browser extension
- Add botserver/ reorganized server code
- Add bottemplates/ bot templates
- Add bottest/ integration tests
- Add botui/ web UI server
- Add CI/CD workflows in .forgejo/workflows/
- Add AGENTS.md and PROD.md documentation
- Add dependency management scripts (DEPENDENCIES.sh/ps1)
- Remove legacy src/ structure and migrations
- Clean up temporary and backup files
2026-04-19 08:14:25 -03:00

50 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
# Generate Android icons from SVG
# Requires: inkscape or rsvg-convert
set -e
cd "$(dirname "$0")/.."
SVG_FILE="icons/gb-bot.svg"
ICON_DIR="icons"
# Android icon sizes
declare -A SIZES=(
["mdpi"]=48
["hdpi"]=72
["xhdpi"]=96
["xxhdpi"]=144
["xxxhdpi"]=192
)
echo "Generating Android icons from $SVG_FILE..."
# Main icon (512x512 for store)
if command -v rsvg-convert &> /dev/null; then
rsvg-convert -w 512 -h 512 "$SVG_FILE" -o "$ICON_DIR/icon.png"
echo "Created icon.png (512x512)"
# Generate density-specific icons
for density in "${!SIZES[@]}"; do
size=${SIZES[$density]}
mkdir -p "$ICON_DIR/$density"
rsvg-convert -w $size -h $size "$SVG_FILE" -o "$ICON_DIR/$density/ic_launcher.png"
echo "Created $density/ic_launcher.png (${size}x${size})"
done
elif command -v inkscape &> /dev/null; then
inkscape -w 512 -h 512 "$SVG_FILE" -o "$ICON_DIR/icon.png"
echo "Created icon.png (512x512)"
for density in "${!SIZES[@]}"; do
size=${SIZES[$density]}
mkdir -p "$ICON_DIR/$density"
inkscape -w $size -h $size "$SVG_FILE" -o "$ICON_DIR/$density/ic_launcher.png"
echo "Created $density/ic_launcher.png (${size}x${size})"
done
else
echo "ERROR: Neither rsvg-convert nor inkscape found!"
echo "Install with: sudo apt install librsvg2-bin"
exit 1
fi
echo "Done! Icons generated in $ICON_DIR/"