diff --git a/scripts/setup.sh b/scripts/setup.sh index e4762c80..8715496e 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -614,10 +614,20 @@ else if has starship; then ok "starship installed"; else warn "starship install failed"; fi fi -# Deploy starship config +# Deploy starship config. Unconditionally cp'ing here overwrote a customised ~/.config/starship.toml on +# every run, silently — the nvim step below already gets this right by guarding on the config's +# existence, so this was just inconsistent. Converge when there is nothing to lose, keep what the user +# wrote when there is. mkdir -p "$HOME/.config" -cp "$SCRIPT_DIR/starship.toml" "$HOME/.config/starship.toml" -ok "starship config deployed" +STARSHIP_DEST="$HOME/.config/starship.toml" +if [ ! -f "$STARSHIP_DEST" ]; then + cp "$SCRIPT_DIR/starship.toml" "$STARSHIP_DEST" + ok "starship config deployed" +elif cmp -s "$SCRIPT_DIR/starship.toml" "$STARSHIP_DEST"; then + skip "starship config (already current)" +else + skip "starship config (yours differs — kept; cp scripts/starship.toml ~/.config/ to take this one)" +fi # Oh-My-Zsh if [ -d "$HOME/.oh-my-zsh" ]; then @@ -866,18 +876,23 @@ fi echo "" echo "── Remote Desktop (Ubuntu Desktop + VNC) ──" -if dpkg -s ubuntu-desktop &>/dev/null 2>&1; then - skip "remote desktop (ubuntu-desktop already installed)" -else - case $PM in - apt) - bash "$SCRIPT_DIR/setup-desktop.sh" - ;; - *) - warn "Remote desktop setup is Ubuntu/Debian only — skipping" - ;; - esac -fi +# No "already installed" guard here on purpose. This used to skip on `dpkg -s ubuntu-desktop`, which +# treats one package being present as proof the whole remote desktop is configured — and those are very +# different things. A host can have ubuntu-desktop and still be missing every part that makes the mirror +# work: GDM auto-login, the forced Xorg session, the captured EDID and its kernel command line, the +# login-time mode setter. That was not hypothetical; it was this machine on 2026-08-02, where the guard +# reported "skip" while five of setup-desktop.sh's steps had never run and /desktop could not survive a +# reboot. setup-desktop.sh is idempotent throughout — every step either no-ops or is individually +# guarded — so letting it run each time converges a partially configured host instead of trusting a +# proxy for state it never actually checked. +case $PM in + apt) + bash "$SCRIPT_DIR/setup-desktop.sh" + ;; + *) + warn "Remote desktop setup is Ubuntu/Debian only — skipping" + ;; +esac # ─── 18. project initialization ────────────────────────────────────────────── echo ""