diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-29 11:42:09 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-29 11:42:09 +0200 |
| commit | ff7dcf3ef2338a0aef1856a33da06d1a92c2434c (patch) | |
| tree | 65f48abed7b214cd27492afadd1aeb7cad90d254 /install.sh | |
| parent | 8164e17276bb37f5f24c9f84df5923c090efed79 (diff) | |
| download | unified-desktop-theme-ff7dcf3ef2338a0aef1856a33da06d1a92c2434c.tar.gz unified-desktop-theme-ff7dcf3ef2338a0aef1856a33da06d1a92c2434c.zip | |
feat(grub): rebuild on every wallpaper change via udt-grub
GRUB's background is a wallpaper snapshot, but only install.sh rebuilt it,
so a wallpaper change left the /boot copy stale with no hint. udt-grub now
holds the build-and-print logic; install.sh runs it in the foreground and
udt-accent starts it detached next to udt-homepage. A stale installed theme
gets a notification carrying the root copy command. A flock serialises the
two runs install.sh triggers, since build swaps dist/udt in by rename.
AGENTS.md: udt-accent writes seven outputs (SDDM was missing), and names
the two detached helpers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 35 |
1 files changed, 6 insertions, 29 deletions
@@ -104,7 +104,7 @@ ln -sfn "$HOME/.cache/udt/colors.json" "$HOME/.cache/wal/colors.json" # The rofi menus are bound by name in hypr-theme's keybindings, so they keep # the names they had when they lived loose in ~/bin. -for f in udt-accent udt-palette udt-machine-name udt-powermenu.sh udt-launcher.sh qar-scrotmenu.sh; do +for f in udt-accent udt-grub udt-palette udt-machine-name udt-powermenu.sh udt-launcher.sh qar-scrotmenu.sh; do ln -sfn "$repo/bin/$f" "$HOME/bin/$f" done @@ -339,34 +339,11 @@ if [ -d "$sddm_repo/theme" ]; then echo " printf '[Theme]\\nCurrent=udt\\n' > /etc/sddm.conf.d/udt.conf" fi -# GRUB. Same shape as SDDM: udt-palette has rendered theme.txt, the sibling -# repo's build assembles the theme as the user, and the root half is printed. -# A copy, not a link: GRUB reads /boot before /home is mounted. The background -# is a snapshot of the wallpaper, so the copy needs rerunning after a scheme -# or wallpaper change; grub-mkconfig only when GRUB_THEME changes. -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 - 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\"" - else - echo "grub: its build failed, theme not refreshed" >&2 - fi -fi +# GRUB. Same shape as SDDM: udt-palette has rendered theme.txt, and udt-grub +# builds the theme as the user and prints the root half. udt-accent also runs +# it, detached, so a wallpaper change alone rebuilds it too. +echo +"$repo/bin/udt-grub" [ -n "$reloaded" ] && echo "reloaded:$reloaded" |
