Files
tri 8425ceb709 feat(tray-icons): shrink and recolor the NetBird tray icons
NetBird sends its tray icon as a pixmap, so an icon theme can't
replace it. patch.py rewrites the 48x48 PNGs embedded in netbird-ui in
place: the glyph is scaled to 80% to get Breeze's padding and the
white variants take the panel text color (#dedede). A pacman hook
re-patches the binary after every netbird-ui upgrade, and restore.sh
puts the original back.
2026-11-06 11:20:04 +07:00

17 lines
706 B
Bash
Executable File

#!/bin/bash
# Patch netbird-ui's tray icons to Breeze proportions.
# Runs as root; the pacman hook re-runs it after every netbird-ui install/upgrade.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
ROOT=${ROOT:-} # for dry-run testing only
bin=$ROOT/usr/bin/netbird-ui
[[ -f $bin ]] || exit 0
# Still the file the package installed: keep it as the original for restore.sh
sum=$(zcat "$ROOT"/var/lib/pacman/local/netbird-ui*/mtree 2>/dev/null \
| grep -F './usr/bin/netbird-ui ' | grep -o 'sha256digest=[0-9a-f]*' | cut -d= -f2 || true)
if [[ -n $sum && $(sha256sum <"$bin" | cut -d' ' -f1) == "$sum" ]]; then
install -Dm755 "$bin" "$here/orig/netbird-ui"
fi
python3 -I "$here/patch.py" "$bin"