From 8164e17276bb37f5f24c9f84df5923c090efed79 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 29 Sep 2026 11:05:33 +0200 Subject: feat(grub): print only the root steps still needed Up to date when the installed theme matches dist/udt, the copy line alone when GRUB_THEME already names the udt theme, the full three steps otherwise. The build is deterministic, so a clean diff -rq means nothing changed. Co-Authored-By: Claude Opus 5.5 --- install.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f8ae97b..b63f8c4 100755 --- a/install.sh +++ b/install.sh @@ -347,11 +347,19 @@ fi grub_repo="$(realpath -m "$repo/../grub-theme-udt")" if [ -x "$grub_repo/build" ]; then if "$grub_repo/build"; then + grub_theme='/boot/grub/themes/udt/theme.txt' echo - echo "grub theme: run these as root to install or refresh it" - echo " rm -rf /boot/grub/themes/udt && cp -r \"$grub_repo/dist/udt\" /boot/grub/themes/" - echo " # once: GRUB_THEME=\"/boot/grub/themes/udt/theme.txt\" in /etc/default/grub, then" - echo " grub-mkconfig -o /boot/grub/grub.cfg" + if diff -rq "$grub_repo/dist/udt" /boot/grub/themes/udt >/dev/null 2>&1; then + echo "grub theme: up to date" + elif grep -q "^GRUB_THEME=\"$grub_theme\"" /etc/default/grub 2>/dev/null; then + echo "grub theme: refresh as root" + echo " rm -rf /boot/grub/themes/udt && cp -r \"$grub_repo/dist/udt\" /boot/grub/themes/" + else + echo "grub theme: run these as root to install or refresh it" + echo " rm -rf /boot/grub/themes/udt && cp -r \"$grub_repo/dist/udt\" /boot/grub/themes/" + echo " # once: GRUB_THEME=\"$grub_theme\" in /etc/default/grub, then" + echo " grub-mkconfig -o /boot/grub/grub.cfg" + fi # The panel title falls back to the OS name until one is set. [ -n "$("$repo/bin/udt-machine-name")" ] || \ echo " # optional, the panel title: sudo \"$repo/bin/udt-machine-name\" \"My Machine\"" -- cgit v1.2.3