diff --git a/README.md b/README.md index 10135a5..fa46345 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ end ## Minimal Mode -Everything opinionated in this config — command shadows, startup side-effects, key and environment overrides, terminal integrations, and logging — is active by default but can be switched off with universal variables. Five category toggles and one master switch are available: +Everything opinionated in this config — command shadows, startup side-effects, key and environment overrides, terminal integrations, logging, and the first-run greeting — is active by default but can be switched off with universal variables. Six category toggles and one master switch are available: | Variable | Disables | |---|---| @@ -175,7 +175,8 @@ Everything opinionated in this config — command shadows, startup side-effects, | `__fish_config_op_overrides` | Vi mode, `exit`→`smart_exit`, `$PAGER`/`$MANPAGER`/`$CDPATH`, bang-bang history expansion, autopair, puffer, Starship prompt, theme colors | | `__fish_config_op_integrations` | Kitty/WezTerm window abbreviations, `done` notifications, `spwin`/`tab`/`split`, `hist`, `logs`, `upgrade`, WakaTime | | `__fish_config_op_logging` | Scrollback capture on exit, `paru`/`yay` AUR log wrappers, Kitty watcher capture (sentinel-file coordinated) | -| `__fish_config_opinionated` | Master switch — all five categories at once | +| `__fish_config_op_greeting` | Per-session `fish_greeting` (suppresses distro greetings such as CachyOS fastfetch by overriding with an empty function); first-run welcome banner | +| `__fish_config_opinionated` | Master switch — all six categories at once | Set any of them to a falsy value (`0`, `false`, `no`, `off`, `n`) to disable; erase the variable to re-enable: diff --git a/conf.d/first_run.fish b/conf.d/first_run.fish index 958f03a..1939c86 100644 --- a/conf.d/first_run.fish +++ b/conf.d/first_run.fish @@ -23,11 +23,16 @@ end set -U __fish_config_first_run_complete 1 # ──────────────────────────── Welcome message ─────────────────────────── -echo "" -echo " Welcome to your fish shell configuration!" -echo " Run 'help config' for offline documentation." -echo " Run 'fish-deps' to check and install dependencies." -echo "" +# Printing a first-run welcome banner is opinionated (C6 greeting). The +# first-run state variable is already set unconditionally above, so +# disabling the greeting never re-triggers this file. +if __fish_config_op_enabled __fish_config_op_greeting + echo "" + echo " Welcome to your fish shell configuration!" + echo " Run 'help config' for offline documentation." + echo " Run 'fish-deps' to check and install dependencies." + echo "" +end # ─────────────────────── Opinionated auto-exec guard ──────────────────── # Startup side-effects below (Fisher curl, fisher update, theme apply) are diff --git a/config.fish b/config.fish index 89a8051..dd1a860 100644 --- a/config.fish +++ b/config.fish @@ -14,6 +14,8 @@ # __fish_config_op_autoexec C2 — startup side-effects # __fish_config_op_overrides C3 — key bindings, env, prompt overrides # __fish_config_op_integrations C4 — terminal/tool coupling +# __fish_config_op_logging C5 — scrollback capture / AUR log wrappers +# __fish_config_op_greeting C6 — per-session greeting / first-run welcome # Example: set -U __fish_config_op_aliases off (erase to re-enable) # ──────────────────────── Source CachyOS configs ──────────────────────── @@ -230,6 +232,16 @@ if status is-interactive # your main config or secrets files. For example, you might want different PATH additions, # aliases, or environment variables on your work laptop vs. your home desktop. test -f "$dot_fish/local.fish"; and source "$dot_fish/local.fish" + + # ─────────────────── C6: Greeting & First-Run UI override ─────────────── + # When the greeting category is disabled, stamp out any fish_greeting + # function that distro configs set (e.g., CachyOS defines it as fastfetch). + # This runs last inside the interactive block so our empty definition wins + # over whatever cachyos-config.fish or vendor conf.d installed. + if not __fish_config_op_enabled __fish_config_op_greeting + function fish_greeting + end + end # # ╭──────────────────────────── END OVERRIDES ──────────────────────────╮ # │ End of override section. │ diff --git a/docs/fish-config.md b/docs/fish-config.md index d8b3938..4244d2b 100644 --- a/docs/fish-config.md +++ b/docs/fish-config.md @@ -1382,7 +1382,7 @@ fish_variables. ## Opinionated Components (Minimal Mode) Every opinionated piece of this config is active by default but can be -switched off through five category opt-out variables, each evaluated via +switched off through six category opt-out variables, each evaluated via __fish_variable_check. Set a variable to any falsy value (0, false, no, off, n) to disable its category; erase it or set a truthy value (1, true, yes, on, y) to re-enable. Unset means enabled. @@ -1415,13 +1415,19 @@ yes, on, y) to re-enable. Unset means enabled. wrappers, Kitty watcher capture; sentinel file coordinates cross-process state + __fish_config_op_greeting Greeting & first-run UI: per-session + fish_greeting override (defines empty + function late in config.fish to + suppress distro greetings such as + CachyOS fastfetch); first-run welcome + banner in conf.d/first_run.fish Examples: # Disable command shadows only (rm becomes plain rm again): set -U __fish_config_op_aliases off - # Full minimal mode — disable all five categories at once: + # Full minimal mode — disable all six categories at once: set -U __fish_config_opinionated 0 # Re-enable everything: @@ -1478,8 +1484,9 @@ on first run via `conf.d/first_run.fish`. Colors are stored in fish_variables Fisher is bootstrapped automatically on the **first interactive session** via `conf.d/first_run.fish`. This also applies the Catppuccin Mocha theme and -prints a one-time welcome message. Subsequent sessions skip all first-run -logic with zero overhead. +prints a one-time welcome message (gated by __fish_config_op_greeting; set +it to 0 to suppress). Subsequent sessions skip all first-run logic with zero +overhead. To re-trigger first-run initialization (e.g., after a fresh install or for testing), run: diff --git a/functions/__fish_config_op_enabled.fish b/functions/__fish_config_op_enabled.fish index 406888e..bc42b0b 100644 --- a/functions/__fish_config_op_enabled.fish +++ b/functions/__fish_config_op_enabled.fish @@ -17,8 +17,10 @@ # ARGUMENTS # category_variable Name (without $) of the category opt-out variable: # __fish_config_op_aliases, __fish_config_op_autoexec, -# __fish_config_op_overrides, or -# __fish_config_op_integrations +# __fish_config_op_overrides, +# __fish_config_op_integrations, +# __fish_config_op_logging, or +# __fish_config_op_greeting # # RETURNS # 0 Component enabled (variables truthy, unset, or unrecognized)