diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-30 20:00:21 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-30 20:00:21 +0200 |
| commit | b29dee9a3b5f77baadb8d788f94b01d4f7535b7f (patch) | |
| tree | 99f24584b346a6689805a52b21b3b757b6e61cc9 | |
| parent | 0ca89376ea0a04ad88ae80b9b602033f3beb8eb6 (diff) | |
| download | unified-desktop-theme-b29dee9a3b5f77baadb8d788f94b01d4f7535b7f.tar.gz unified-desktop-theme-b29dee9a3b5f77baadb8d788f94b01d4f7535b7f.zip | |
fix(install): raise the install tab only when there is something to do
The recap was handed to the steps window on every run, so the file always
existed. Any later poke, such as udt-grub or udt-homepage starting from a
login's wallpaper restore, reopened the window on an old summary with
nothing to act on. Keep the tab only when install.sh failed or printed a
command; clear it otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | AGENTS.md | 5 | ||||
| -rwxr-xr-x | install.sh | 11 |
2 files changed, 11 insertions, 5 deletions
@@ -186,8 +186,9 @@ tab, so each producer reports on every run and a consumer that caught up disappears by itself. The producers are `udt-grub`, `udt-homepage`, `install.sh`'s SDDM block (only the steps still missing), and `install.sh` itself, which reruns itself as a child and hands its whole output to an -`install` tab on every run, whoever called it: the usual caller is the -appearance panel, not a terminal. So its output is written for that tab, a +`install` tab whenever it failed or printed a command, whoever called it, and +clears the tab otherwise, so a login's wallpaper restore does not reopen an +old recap. The usual caller is the appearance panel, not a terminal. So its output is written for that tab, a summary rather than a file list. A line indented two spaces is a command with a copy button; the rest is prose. It replaced notification balloons, which could not be kept open while pasting into a root shell. @@ -8,14 +8,19 @@ repo="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" target="$HOME/.config/rofi/udt" # Everything this prints also becomes the install tab of quickshell's steps -# window, from whichever caller: the usual one is the appearance panel, not a -# terminal, so the hints are assumed wanted on screen. The script reruns -# itself as a child so the output can be both shown live and kept whole. +# window when there is something to do, from whichever caller: the usual one +# is the appearance panel, not a terminal, so the hints are assumed wanted on +# screen. The script reruns itself as a child so the output can be both shown +# live and kept whole. if [ -z "${UDT_INSTALL_CHILD:-}" ]; then log="$(mktemp)" trap 'rm -f "$log"' EXIT rc=0 UDT_INSTALL_CHILD=1 "$repo/install.sh" "$@" 2>&1 | tee "$log" || rc=$? + # Only a failure or a command to run (a line indented two spaces) is + # something to do; otherwise the tab is cleared, so a login's wallpaper + # restore, which pokes the window, does not reopen a stale recap. + if [ "$rc" -eq 0 ] && ! grep -q '^ ' "$log"; then : > "$log"; fi "$repo/bin/udt-steps" install < "$log" exit "$rc" fi |
