2020-10-16 20:23:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
INKSCAPE="/usr/bin/inkscape"
|
2021-08-07 11:07:05 +02:00
|
|
|
OPTIPNG="/usr/bin/optipng"
|
2020-10-16 20:23:41 +02:00
|
|
|
|
2021-01-25 16:54:41 +01:00
|
|
|
if [[ "$1" == "select" ]]; then
|
2020-10-16 20:23:41 +02:00
|
|
|
EXPORT_TYPE="select"
|
2021-01-25 16:54:41 +01:00
|
|
|
INDEX="select.txt"
|
|
|
|
SRC_FILE="select.svg"
|
2020-10-16 20:23:41 +02:00
|
|
|
else
|
2021-01-25 16:54:41 +01:00
|
|
|
EXPORT_TYPE="icons"
|
|
|
|
INDEX="logos.txt"
|
|
|
|
SRC_FILE="logos-$1.svg"
|
2020-10-16 20:23:41 +02:00
|
|
|
fi
|
|
|
|
|
2021-01-25 16:54:41 +01:00
|
|
|
if [[ "$2" == "1080p" ]]; then
|
|
|
|
ASSETS_DIR="assets-$1/$EXPORT_TYPE-1080p"
|
2020-10-16 20:23:41 +02:00
|
|
|
EXPORT_DPI="96"
|
2021-01-25 16:54:41 +01:00
|
|
|
elif [[ "$2" == "2k" ]] || [[ "$2" == "2K" ]]; then
|
|
|
|
ASSETS_DIR="assets-$1/$EXPORT_TYPE-2k"
|
2020-10-16 20:23:41 +02:00
|
|
|
EXPORT_DPI="144"
|
2021-01-25 16:54:41 +01:00
|
|
|
elif [[ "$2" == "4k" ]] || [[ "$2" == "4K" ]]; then
|
|
|
|
ASSETS_DIR="assets-$1/$EXPORT_TYPE-4k"
|
2020-10-16 20:23:41 +02:00
|
|
|
EXPORT_DPI="192"
|
|
|
|
else
|
|
|
|
echo "Please use either '1080p', '2k' or '4k'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
install -d "$ASSETS_DIR"
|
|
|
|
|
|
|
|
while read -r i; do
|
|
|
|
if [[ -f "$ASSETS_DIR/$i.png" ]]; then
|
|
|
|
echo "$ASSETS_DIR/$i.png exists"
|
|
|
|
elif [[ "$i" == "" ]]; then
|
|
|
|
continue
|
|
|
|
else
|
|
|
|
echo -e "\nRendering $ASSETS_DIR/$i.png"
|
|
|
|
$INKSCAPE "--export-id=$i" \
|
|
|
|
"--export-dpi=$EXPORT_DPI" \
|
|
|
|
"--export-id-only" \
|
|
|
|
"--export-filename=$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
|
2021-08-07 11:07:05 +02:00
|
|
|
$OPTIPNG -strip all -nc "$ASSETS_DIR/$i.png"
|
2020-10-16 20:23:41 +02:00
|
|
|
fi
|
|
|
|
done < "$INDEX"
|
|
|
|
|
|
|
|
if [[ "$EXPORT_TYPE" == "icons" ]]; then
|
2021-08-07 11:19:56 +02:00
|
|
|
cd "$ASSETS_DIR" || exit 1
|
2020-10-16 20:23:41 +02:00
|
|
|
cp -a archlinux.png arch.png
|
|
|
|
cp -a gnu-linux.png linux.png
|
|
|
|
cp -a gnu-linux.png unknown.png
|
|
|
|
cp -a gnu-linux.png lfs.png
|
|
|
|
cp -a manjaro.png Manjaro.i686.png
|
|
|
|
cp -a manjaro.png Manjaro.x86_64.png
|
2021-03-30 15:44:28 +02:00
|
|
|
cp -a manjaro.png manjarolinux.png
|
2020-12-20 13:59:19 +01:00
|
|
|
cp -a pop-os.png pop.png
|
2020-10-16 20:23:41 +02:00
|
|
|
cp -a driver.png memtest.png
|
|
|
|
fi
|
|
|
|
exit 0
|