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 • 801 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)" || true
6
OPTIPNG="$(command -v optipng)" || true
7
8
if [[ -n "${INKSCAPE}" ]]; then
9
if "$INKSCAPE" --help | grep -e "--export-filename" > /dev/null; then
10
EXPORT_FILE_OPTION="--export-filename"
11
elif "$INKSCAPE" --help | grep -e "--export-file" > /dev/null; then
12
EXPORT_FILE_OPTION="--export-file"
13
elif "$INKSCAPE" --help | grep -e "--export-png" > /dev/null; then
14
EXPORT_FILE_OPTION="--export-png"
15
fi
16
fi
17
18
i="$1"
19
20
echo "Rendering '$i.png'"
21
22
if [[ -n "${RENDER_SVG}" ]]; then
23
"$RENDER_SVG" --dpi 96 "$i.svg" "$i.png"
24
else
25
"$INKSCAPE" --export-dpi=96 "$EXPORT_FILE_OPTION"="$i.png" "$i.svg" >/dev/null
26
fi
27
28
if [[ -n "${OPTIPNG}" ]]; then
29
"$OPTIPNG" -o7 --quiet "$i.png"
30
fi
31