render-assets.sh 850 B

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/bash
  2. INKSCAPE="flatpak run org.inkscape.Inkscape"
  3. OPTIPNG="/usr/bin/optipng"
  4. SRC_FILE="assets.svg"
  5. ASSETS_DIR="assets"
  6. INDEX="assets.txt"
  7. for i in `cat $INDEX`
  8. do
  9. if [ -f $ASSETS_DIR/$i.png ]; then
  10. echo $ASSETS_DIR/$i.png exists.
  11. else
  12. echo
  13. echo Rendering $ASSETS_DIR/$i.png
  14. $INKSCAPE --export-id=$i \
  15. --export-id-only \
  16. --export-png=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null #\
  17. # && $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
  18. fi
  19. if [ -f $ASSETS_DIR/[email protected] ]; then
  20. echo $ASSETS_DIR/[email protected] exists.
  21. else
  22. echo
  23. echo Rendering $ASSETS_DIR/[email protected]
  24. $INKSCAPE --export-id=$i \
  25. --export-dpi=180 \
  26. --export-id-only \
  27. --export-png=$ASSETS_DIR/[email protected] $SRC_FILE >/dev/null #\
  28. # && $OPTIPNG -o7 --quiet $ASSETS_DIR/[email protected]
  29. fi
  30. done
  31. exit 0