aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-grub
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-29 11:56:14 +0200
committerDanilo M. <danix@danix.xyz>2026-09-29 11:56:14 +0200
commit3bcadc0fd35cb1e077a77c847bbc044ca2fabce3 (patch)
tree9cc8bb74806eb266b0244c40858dfa0b9e9026e2 /bin/udt-grub
parentff7dcf3ef2338a0aef1856a33da06d1a92c2434c (diff)
downloadunified-desktop-theme-3bcadc0fd35cb1e077a77c847bbc044ca2fabce3.tar.gz
unified-desktop-theme-3bcadc0fd35cb1e077a77c847bbc044ca2fabce3.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'bin/udt-grub')
-rwxr-xr-xbin/udt-grub48
1 files changed, 29 insertions, 19 deletions
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