sunnypilot v2026.002.000
version: sunnypilot v2026.002.000 (staging) date: 2026-07-21T07:44:02 master commit: 2c334ede443d7391d27575af8c854a095ba702a8
This commit is contained in:
commit
de77c89cf6
3995 files changed
+1260688
No files matched your search
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
ICONS_DIR="$DIR/icons"
|
||||
BOOTSTRAP_SVG="$(python3 -c 'import bootstrap_icons; print(bootstrap_icons.SVG_PATH)')"
|
||||
|
||||
ICON_IDS=(
|
||||
arrow-right
|
||||
backspace
|
||||
capslock-fill
|
||||
shift
|
||||
shift-fill
|
||||
)
|
||||
ICON_FILL_COLOR="#fff"
|
||||
|
||||
# extract bootstrap icons
|
||||
for id in "${ICON_IDS[@]}"; do
|
||||
svg="${ICONS_DIR}/${id}.svg"
|
||||
perl -0777 -ne "print \$& if /<symbol[^>]*id=\"$id\"[^>]*>.*?<\/symbol>/s" "$BOOTSTRAP_SVG" \
|
||||
| sed "s/<symbol/<svg fill=\"$ICON_FILL_COLOR\"/; s/<\/symbol>/<\/svg>/" > "$svg"
|
||||
done
|
||||
|
||||
# sudo apt install inkscape
|
||||
|
||||
for svg in $(find $DIR -type f | grep svg$); do
|
||||
bunx svgo $svg --multipass --pretty --indent 2
|
||||
|
||||
# convert to PNG
|
||||
png="${svg%.svg}.png"
|
||||
width=$(inkscape --query-width "$svg")
|
||||
height=$(inkscape --query-height "$svg")
|
||||
if (( $(echo "$width > $height" | bc -l) )); then
|
||||
export_dim="--export-width=512"
|
||||
else
|
||||
export_dim="--export-height=512"
|
||||
fi
|
||||
inkscape "$svg" --export-filename="$png" "$export_dim"
|
||||
|
||||
optipng -o7 -strip all "$png"
|
||||
done
|
||||
|
||||
# cleanup bootstrap SVGs
|
||||
for id in "${ICON_IDS[@]}"; do
|
||||
rm "${ICONS_DIR}/${id}.svg"
|
||||
done
|
||||
Reference in new issue
Block a user