#!/bin/sh # Regenerate alkane-toolkit.ico (the Windows executable/taskbar icon) from the # in-repo microchip glyph: a white chip on a rounded amber tile, at the sizes # Windows asks for (16-256 px). Needs rsvg-convert and ImageMagick; the .ico is # committed, so a normal build never runs this. set -e cd "$(dirname "$0")" GLYPH=../assets/icons/microchip-solid-full.svg TMP=$(mktemp -d) trap 'rm -rf "$TMP"' 0 sed 's/currentColor/#ffffff/g; s/ "$TMP/glyph.svg" for s in 16 20 24 32 40 48 64 256; do r=$((s * 22 / 100)); g=$((s * 64 / 100)); o=$(((s - g) / 2)) rsvg-convert -w "$g" -h "$g" "$TMP/glyph.svg" -o "$TMP/g$s.png" convert -size "${s}x${s}" xc:none -fill '#d9822b' \ -draw "roundrectangle 0,0 $((s - 1)),$((s - 1)) $r,$r" \ "$TMP/g$s.png" -geometry "+$o+$o" -composite "PNG32:$TMP/i$s.png" done convert "$TMP"/i16.png "$TMP"/i20.png "$TMP"/i24.png "$TMP"/i32.png "$TMP"/i40.png \ "$TMP"/i48.png "$TMP"/i64.png "$TMP"/i256.png alkane-toolkit.ico echo "wrote $(pwd)/alkane-toolkit.ico"