BlueGit

ict rusty-teams

Files

rusty-teams / packaging / linux / icons.sh

icons.sh

feat(packaging): Linux AppImage, deb, rpm and Flatpak
metis Samuel David Merlin Kemper · pushed by metis · 2 weeks ago
228f36c5 History
icons.sh 1.1 KiB Download Raw
1#!/usr/bin/env bash
2# Regenerate the Linux hicolor theme icons in packaging/linux/hicolor from the app icon
3# (crates/app/assets/icon/teams-fast-256.png, the one the app writes when it installs
4# itself, see AppIcon::RustyTeams in crates/app-base/src/appearance.rs).
5#
6# Needs ImageMagick (magick or convert). The outputs are committed, so packaging never
7# needs it.
8#
9# packaging/linux/icons.sh
10set -euo pipefail
11ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
12SRC="$ROOT/crates/app/assets/icon/teams-fast-256.png"
13OUT="$ROOT/packaging/linux/hicolor"
14NAME=rusty-teams
15
16if command -v magick >/dev/null; then IM=(magick); elif command -v convert >/dev/null; then IM=(convert); else
17 echo "error: ImageMagick not found (apt install imagemagick)" >&2
18 exit 1
19fi
20
21rm -rf "$OUT"
22for s in 16 24 32 48 64 128 256; do
23 mkdir -p "$OUT/${s}x${s}/apps"
24 # -strip drops timestamps and profiles, so a rerun on the same source is byte-identical.
25 "${IM[@]}" "$SRC" -filter Lanczos -resize "${s}x${s}" -strip "PNG32:$OUT/${s}x${s}/apps/$NAME.png"
26done
27echo "icons written to $OUT"