Debian Codegraph @

gtk/theme/Default/render-assets.sh

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