From 35c1939f28b314cc82d8cc156bdb2e675973fe89 Mon Sep 17 00:00:00 2001 From: Pathfinder Date: Mon, 2 Nov 2026 16:58:34 +0100 Subject: [PATCH] Tailoring: wire starship into .bashrc only when dotfiles are absent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per YuKu: after the starship install, append export STARSHIP_CONFIG=$HOME/.config/starship.toml eval "$(starship init bash)" to ~/.bashrc — but ONLY when fedora-dots was NOT cloned (on dots machines .bashrc belongs to the dots). Also gated on starship actually being present (no dead eval in every shell) and idempotent (grep guard). Harness: appended once with dots=no, never with dots=yes (clean-home re-test; the first test was invalid because rm -rf home/* left the previous .bashrc — the known dotfile-cleanup pitfall), and not duplicated on re-run. --- setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.sh b/setup.sh index b8a0eee..e5f2195 100755 --- a/setup.sh +++ b/setup.sh @@ -606,6 +606,22 @@ if command -v starship >/dev/null 2>&1 && [[ ! -f "$HOME/.config/starship.toml" starship preset tokyo-night -o "$HOME/.config/starship.toml" \ || warn "Could not apply the preset (starship still installed)." fi + +# bashrc wiring — ONLY when dotfiles were not cloned: on machines that +# use fedora-dots, .bashrc is owned by the dots and must not be edited +# here. Also requires starship to actually be present (a missing binary +# would make every shell print an error from the eval line). +if [[ "$DOTFILES" != "true" ]] \ + && command -v starship >/dev/null 2>&1 \ + && ! grep -q "starship init" "$HOME/.bashrc" 2>/dev/null; then + info "Wiring starship into ~/.bashrc..." + cat >> "$HOME/.bashrc" <<'EOF' + +# starship +export STARSHIP_CONFIG="$HOME/.config/starship.toml" +eval "$(starship init bash)" +EOF +fi pause_if_debug # --- 8.3 RobotoMono Nerd Font (the modules install JetBrainsMono) ---