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.
This commit is contained in:
1 parent
fa77bc2514
commit
8425ceb709
7 files changed
+263
-3
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#!/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"
|
||||
Reference in new issue
Block a user