feat(greeting): add C6 — Greeting & First-Run UI opinionated guard #40
@@ -166,7 +166,7 @@ end
|
|||||||
|
|
||||||
## Minimal Mode
|
## 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 |
|
| 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_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_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_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:
|
Set any of them to a falsy value (`0`, `false`, `no`, `off`, `n`) to disable; erase the variable to re-enable:
|
||||||
|
|
||||||
|
|||||||
+10
-5
@@ -23,11 +23,16 @@ end
|
|||||||
set -U __fish_config_first_run_complete 1
|
set -U __fish_config_first_run_complete 1
|
||||||
|
|
||||||
# ──────────────────────────── Welcome message ───────────────────────────
|
# ──────────────────────────── Welcome message ───────────────────────────
|
||||||
echo ""
|
# Printing a first-run welcome banner is opinionated (C6 greeting). The
|
||||||
echo " Welcome to your fish shell configuration!"
|
# first-run state variable is already set unconditionally above, so
|
||||||
echo " Run 'help config' for offline documentation."
|
# disabling the greeting never re-triggers this file.
|
||||||
echo " Run 'fish-deps' to check and install dependencies."
|
if __fish_config_op_enabled __fish_config_op_greeting
|
||||||
echo ""
|
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 ────────────────────
|
# ─────────────────────── Opinionated auto-exec guard ────────────────────
|
||||||
# Startup side-effects below (Fisher curl, fisher update, theme apply) are
|
# Startup side-effects below (Fisher curl, fisher update, theme apply) are
|
||||||
|
|||||||
+12
@@ -14,6 +14,8 @@
|
|||||||
# __fish_config_op_autoexec C2 — startup side-effects
|
# __fish_config_op_autoexec C2 — startup side-effects
|
||||||
# __fish_config_op_overrides C3 — key bindings, env, prompt overrides
|
# __fish_config_op_overrides C3 — key bindings, env, prompt overrides
|
||||||
# __fish_config_op_integrations C4 — terminal/tool coupling
|
# __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)
|
# Example: set -U __fish_config_op_aliases off (erase to re-enable)
|
||||||
|
|
||||||
# ──────────────────────── Source CachyOS configs ────────────────────────
|
# ──────────────────────── 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,
|
# 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.
|
# aliases, or environment variables on your work laptop vs. your home desktop.
|
||||||
test -f "$dot_fish/local.fish"; and source "$dot_fish/local.fish"
|
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 OVERRIDES ──────────────────────────╮
|
||||||
# │ End of override section. │
|
# │ End of override section. │
|
||||||
|
|||||||
+11
-4
@@ -1382,7 +1382,7 @@ fish_variables.
|
|||||||
## Opinionated Components (Minimal Mode)
|
## Opinionated Components (Minimal Mode)
|
||||||
|
|
||||||
Every opinionated piece of this config is active by default but can be
|
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,
|
__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,
|
off, n) to disable its category; erase it or set a truthy value (1, true,
|
||||||
yes, on, y) to re-enable. Unset means enabled.
|
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;
|
wrappers, Kitty watcher capture;
|
||||||
sentinel file coordinates
|
sentinel file coordinates
|
||||||
cross-process state
|
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:
|
Examples:
|
||||||
|
|
||||||
# Disable command shadows only (rm becomes plain rm again):
|
# Disable command shadows only (rm becomes plain rm again):
|
||||||
set -U __fish_config_op_aliases off
|
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
|
set -U __fish_config_opinionated 0
|
||||||
|
|
||||||
# Re-enable everything:
|
# 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
|
Fisher is bootstrapped automatically on the **first interactive session** via
|
||||||
`conf.d/first_run.fish`. This also applies the Catppuccin Mocha theme and
|
`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
|
prints a one-time welcome message (gated by __fish_config_op_greeting; set
|
||||||
logic with zero overhead.
|
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
|
To re-trigger first-run initialization (e.g., after a fresh install or for
|
||||||
testing), run:
|
testing), run:
|
||||||
|
|||||||
@@ -17,8 +17,10 @@
|
|||||||
# ARGUMENTS
|
# ARGUMENTS
|
||||||
# category_variable Name (without $) of the category opt-out variable:
|
# category_variable Name (without $) of the category opt-out variable:
|
||||||
# __fish_config_op_aliases, __fish_config_op_autoexec,
|
# __fish_config_op_aliases, __fish_config_op_autoexec,
|
||||||
# __fish_config_op_overrides, or
|
# __fish_config_op_overrides,
|
||||||
# __fish_config_op_integrations
|
# __fish_config_op_integrations,
|
||||||
|
# __fish_config_op_logging, or
|
||||||
|
# __fish_config_op_greeting
|
||||||
#
|
#
|
||||||
# RETURNS
|
# RETURNS
|
||||||
# 0 Component enabled (variables truthy, unset, or unrecognized)
|
# 0 Component enabled (variables truthy, unset, or unrecognized)
|
||||||
|
|||||||
Reference in New Issue
Block a user