distrohop/add-icon.sh

14 lines
349 B
Bash
Raw Permalink Normal View History

2025-02-12 19:33:11 -08:00
#!/bin/bash
iconset="${1%%:*}"
icon="${1#*:}"
2025-02-14 19:39:18 -08:00
BASE_DIR="./assets/icons"
2025-02-12 19:33:11 -08:00
mkdir -p "$BASE_DIR/$iconset"
wget -4 -O "$BASE_DIR/$iconset/$icon.svg" "https://api.iconify.design/$iconset/$icon.svg"
sed -i -E \
-e 's/<svg/<svg id="icon"/' \
-e 's/width="[^"]+"/width="100%"/g' \
-e 's/height="[^"]+"/height="100%"/g' \
"$BASE_DIR/$iconset/$icon.svg"