* fix(linux): restore multi-size hicolor icons for Ubuntu launchers (#1340) PR #816 set linux.icon to a single 1024px PNG, which regressed the #274 fix and left only hicolor/1024x1024 on .deb installs. Drop the override so electron-builder uses build/icons again, regenerate those PNGs from the tight-crop icon-win source, and add a helper script plus a config test. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(linux): set linux.icon to icons dir for proper multi-size hicolor icons (#1340) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
891 B
Bash
Executable File
32 lines
891 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Generate build/icons/* from public/icon-win.png for Linux packaging.
|
|
# electron-builder installs these into /usr/share/icons/hicolor/<size>/apps/.
|
|
#
|
|
# Requires ImageMagick (`convert`). Run from repo root:
|
|
# ./scripts/generate-linux-icons.sh
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
SOURCE="$ROOT/public/icon-win.png"
|
|
OUT_DIR="$ROOT/build/icons"
|
|
|
|
if command -v magick >/dev/null 2>&1; then
|
|
CONVERT=(magick)
|
|
elif command -v convert >/dev/null 2>&1; then
|
|
CONVERT=(convert)
|
|
else
|
|
echo "error: ImageMagick is required (magick or convert)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -f "$SOURCE" ]]; then
|
|
echo "error: source icon not found: $SOURCE" >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$OUT_DIR"
|
|
for size in 16 32 48 64 128 256 512; do
|
|
"${CONVERT[@]}" "$SOURCE" -resize "${size}x${size}!" "$OUT_DIR/${size}x${size}.png"
|
|
echo "wrote build/icons/${size}x${size}.png"
|
|
done
|