From 3bcadc0fd35cb1e077a77c847bbc044ca2fabce3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 29 Sep 2026 11:56:14 +0200 Subject: feat(steps): hand pending root steps to a quickshell window Notification balloons carried the GRUB and homepage root commands, but a balloon cannot stay open while its commands are pasted into a root shell. bin/udt-steps NAME writes a consumer's pending steps to ~/.cache/udt/steps/NAME and pokes quickshell's appearance shell, which shows one tab per file on DP-3. Empty stdin clears the tab, so producers report on every run and a consumer that caught up drops out by itself. udt-grub and udt-homepage now route through it. install.sh's SDDM block checks what is installed and reports only the steps still missing, rather than printing the full install on every run. udt-homepage remembers the last staged pair, since udt-accent now also runs on icon switches, which change neither file and would re-raise the finish steps for nothing. Co-Authored-By: Claude Opus 5.5 --- bin/udt-grub | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'bin/udt-grub') diff --git a/bin/udt-grub b/bin/udt-grub index 20fd296..273389c 100755 --- a/bin/udt-grub +++ b/bin/udt-grub @@ -10,8 +10,8 @@ # and a scheme switch leave the copy stale. # # udt-accent starts this detached on every run; install.sh runs it in the -# foreground. A notification goes out only when an installed theme is stale: -# a machine that never installed it has nothing to refresh. +# foreground. The root steps go to the steps window through udt-steps, and +# the tab clears itself once /boot matches the build. repo="$(dirname "$(readlink -f "$0")")/.." grub_repo="$(realpath -m "$repo/../grub-theme-udt")" @@ -28,23 +28,33 @@ flock 9 theme=/boot/grub/themes/udt copy="rm -rf $theme && cp -r \"$grub_repo/dist/udt\" /boot/grub/themes/" -if diff -rq "$grub_repo/dist/udt" "$theme" >/dev/null 2>&1; then - echo "grub theme: up to date" -elif [ -d "$theme" ]; then - echo "grub theme: refresh as root" +steps() { + if diff -rq "$grub_repo/dist/udt" "$theme" >/dev/null 2>&1; then + return + elif [ -d "$theme" ]; then + echo "The GRUB theme was rebuilt. Refresh the copy in /boot as root:" + else + echo "The GRUB theme is built but not installed. As root:" + fi echo " $copy" - command -v notify-send >/dev/null 2>&1 && - notify-send -a udt "grub: theme rebuilt" "As root: -$copy" -else - echo "grub theme: run these as root to install it" - echo " $copy" -fi -grep -q "^GRUB_THEME=\"$theme/theme.txt\"" /etc/default/grub 2>/dev/null || { - echo " # once: GRUB_THEME=\"$theme/theme.txt\" in /etc/default/grub, then" - echo " grub-mkconfig -o /boot/grub/grub.cfg" + grep -q "^GRUB_THEME=\"$theme/theme.txt\"" /etc/default/grub 2>/dev/null || { + echo + echo "Once, set GRUB_THEME=\"$theme/theme.txt\" in /etc/default/grub, then:" + echo " grub-mkconfig -o /boot/grub/grub.cfg" + } + # The panel title falls back to the OS name until one is set. + [ -n "$("$repo/bin/udt-machine-name")" ] || { + echo + echo "Optional, the panel title:" + echo " \"$repo/bin/udt-machine-name\" \"My Machine\"" + } } -# 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\"" + +out="$(steps)" +echo "grub theme: ${out:-up to date}" +# A theme that was never installed stays out of the steps window: a wallpaper +# change would otherwise keep asking for an install nobody wanted. +if [ -d "$theme" ] || [ -z "$out" ]; then + printf '%s' "$out" | "$repo/bin/udt-steps" grub +fi exit 0 -- cgit v1.2.3