A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 render-asset.sh

View raw Download
text/x-shellscript • 990 B
Bourne-Again shell script, ASCII text executable
        
            
1
#!/bin/bash
2
set -ueo pipefail
3
4
RENDER_SVG="$(command -v rendersvg)" || true
5
INKSCAPE="$(command -v inkscape)"
6
OPTIPNG="$(command -v optipng)"
7
8
SRC_FILE="assets.svg"
9
ASSETS_DIR="assets"
10
11
i="$1"
12
13
echo "Rendering '$ASSETS_DIR/$i.png'"
14
if [[ -n "${RENDER_SVG}" ]] ; then
15
"$RENDER_SVG" --export-id "$i" \
16
"$SRC_FILE" "$ASSETS_DIR/$i.png"
17
else
18
"$INKSCAPE" --export-id="$i" \
19
--export-id-only \
20
--export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
21
fi
22
"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"
23
24
echo "Rendering '$ASSETS_DIR/$i@2.png'"
25
if [[ -n "${RENDER_SVG}" ]] ; then
26
# @TODO: remove --zoom when it will be fixed/implemented in resvg
27
"$RENDER_SVG" --export-id "$i" \
28
--dpi 192 \
29
--zoom 2 \
30
"$SRC_FILE" "$ASSETS_DIR/$i@2.png"
31
else
32
"$INKSCAPE" --export-id="$i" \
33
--export-id-only \
34
--export-dpi=192 \
35
--export-png="$ASSETS_DIR/$i@2.png" "$SRC_FILE" >/dev/null
36
fi
37
"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i@2.png"
38