aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-29 11:05:33 +0200
committerDanilo M. <danix@danix.xyz>2026-09-29 11:05:33 +0200
commit8164e17276bb37f5f24c9f84df5923c090efed79 (patch)
tree04399c05c100427a625c6a4fbccfd0a6c3676d4f
parent4645998b64815d15aef6efe00dcbdfc4a045359e (diff)
downloadunified-desktop-theme-8164e17276bb37f5f24c9f84df5923c090efed79.tar.gz
unified-desktop-theme-8164e17276bb37f5f24c9f84df5923c090efed79.zip
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 <noreply@anthropic.com>
-rwxr-xr-xinstall.sh16
1 files 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\""