Files
fish-config/functions/_fish_deps_catalog.fish
T
rootiest c17f6663db feat(deps): add Optional/Terminal Emulator tiers, fix docker prompt hang and ov install path
Reworks fish-deps' dependency classification from three tiers to five:
Required, Recommended, Optional, Terminal Emulators, and Integrations.

- Add an Optional tier for single-purpose wrapper conveniences that only
  matter if you already use that specific tool (btop, dust, duf,
  prettyping, go, lazygit, lazydocker, docker, yt-dlp, screen). Skipped by
  `fish-deps install`/`sync` by default.
- Split kitty/wezterm into their own Terminal Emulators tier, since only
  the one matching $TERM is ever relevant to a given user.
- Add --optional, --terminals, and --all flags to `install`/`sync` to
  opt back into the skipped tiers, with a summary of how many were
  skipped and which flag restores them.
- Fix `_fish_deps_status` marking missing Integrations as critical (red)
  the same as Required — only Required is red now; Recommended stays
  yellow, everything else renders as a neutral dim note.

Also fixes two bugs surfaced during dependency testing on a fresh
install:

- `fish_right_prompt` called `docker context show` on every prompt with
  no `type -q docker` guard, unlike every other optional integration in
  this config — on a system without docker this printed a visible
  "Unknown command: docker" block on every single prompt render. Added
  the missing guard, and hardened the `ld` wrapper with explicit
  docker/lazydocker presence checks.
- `ov`'s catalog entry offered `cargo install ov` as its preferred
  install method, but crates.io's `ov` is an unrelated crate, not the
  noborus/ov pager — cargo would silently install the wrong package.
  Removed the cargo path; `ov` now prefers `go install
  github.com/noborus/ov@latest` (ahead of the system PM) when go is
  available, since not all distros package `ov` in their base repos,
  and falls back to the system PM otherwise.
2026-08-14 16:42:37 -04:00

92 lines
3.4 KiB
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# SYNOPSIS
# _fish_deps_catalog
#
# DESCRIPTION
# Populates parallel global arrays (_fdc_bins, _fdc_tiers, _fdc_cargo,
# _fdc_pm, _fdc_special) describing every managed shell dependency.
# Must be called before accessing any _fdc_* array.
#
# Tiers:
# req Required — the shell does not function without these.
# rec Recommended — meaningfully enhance the experience across
# multiple functions; the bulk of the
# catalog.
# opt Optional — minor, single-purpose wrapper
# conveniences (e.g. backs one wrapper
# function) that only matter if you already
# use that specific tool. Skipped by
# `fish-deps install`/`sync` unless
# `--optional` (or `--all`) is passed.
# term Terminal Emulators — GPU-accelerated terminal emulators
# (kitty, wezterm) that only matter if one
# of them is your actual terminal. Skipped
# by `fish-deps install`/`sync` unless
# `--terminals` (or `--all`) is passed.
# int Integrations — opt-in third-party services requiring
# their own account/setup (wakatime,
# tailscale).
#
# EXAMPLE
# _fish_deps_catalog
# echo $_fdc_bins
function _fish_deps_catalog
set -g _fdc_bins \
uv cargo fish starship fzf zoxide direnv paru yay \
wakatime tailscale \
eza lsd bat btop dust duf prettyping go ov rg lazygit lazydocker docker trash kitty wezterm python3 yt-dlp screen
set -g _fdc_tiers \
rec rec req rec req rec rec rec rec \
int int \
rec rec rec opt opt opt opt opt rec rec opt opt opt rec term term rec opt opt
set -g _fdc_cargo \
"" "" "" starship "" zoxide "" "" "" \
"" "" \
eza lsd bat "" du-dust "" "" "" "" ripgrep "" "" "" trashy "" "" "" "" ""
set -g _fdc_pm \
uv cargo fish starship fzf zoxide direnv "" yay \
wakatime tailscale \
eza lsd bat btop dust duf prettyping go ov ripgrep lazygit lazydocker docker trash kitty wezterm python yt-dlp screen
set -g _fdc_special \
curl-uv rustup-installer git-cargo-fish curl-installer fzf-update "" "" paru-build yay-build \
wakatime-binary "" \
"" "" "" "" "" "" "" "" go-ov "" "" curl-lazydocker "" "" "" "" "" "" ""
end
# SYNOPSIS
# _fish_deps_catalog_idx <bin>
#
# DESCRIPTION
# Returns the 1-based index of a binary name in the _fdc_bins catalog array,
# or an empty string if the binary is not found.
#
# ARGUMENTS
# bin The binary name to look up in the catalog
#
# EXIT STATUS
# 0 Binary found in the catalog
# 1 Binary not found
#
# RETURNS
# The binary's 1-based catalog index, printed to stdout (nothing on failure)
#
# EXAMPLE
# _fish_deps_catalog_idx fzf
function _fish_deps_catalog_idx --argument-names bin
_fish_deps_catalog
set -l i 1
for b in $_fdc_bins
if test "$b" = "$bin"
echo $i
return
end
set i (math $i + 1)
end
end