Compare commits

..

4 Commits

Author SHA1 Message Date
rootiest 1a6f1f3f2c feat(deps): add status symbols to fish-deps status output
Installed deps show a green ✓. Missing required/integration deps show
a red ✗. Missing recommended deps show a yellow ⚠ since they are
optional, distinguishing severity at a glance.
2026-05-18 21:56:50 -04:00
rootiest b82766ad52 feat(deps): add yay as supported AUR helper alongside paru
yay uses the same -S --noconfirm interface as paru. Detection priority
is paru > yay > pacman so paru is preferred when both are present.
When installing paru itself via paru-build special, yay -S paru is
offered as a method when yay is available, in addition to the
makepkg-from-source fallback.
2026-05-18 21:52:56 -04:00
rootiest 9b342114aa feat(deps): add fish-deps unified dependency management command
Introduces `fish-deps` with four subcommands:
- status: colored installed/missing report per tier (required/integrations/recommended)
- install: interactively install each missing dep, prompts method when multiple exist
- update: update all installed deps using their preferred method
- sync: install missing then update installed

Install method priority: cargo (Rust tools get latest crate) > system PM
(paru/pacman/apt/brew/pkg/dnf/yum) > git clone (fzf via fzf-update) >
curl installer (starship, fisher) > pipx (wakatime).

Splits into focused helper files:
- _fish_deps_catalog.fish: parallel-array dep catalog with tiers, cargo crates, PM names, special install keys
- _fish_deps_pm.fish: PM detection and install/upgrade helpers
- _fish_deps_status.fish: tier-grouped colored status display
- _fish_deps_install.fish: per-dep interactive install with method selection
- _fish_deps_update.fish: per-dep update using known install method

check_fish_deps becomes a thin wrapper delegating to `fish-deps status`.
README updated with Dependency Management section.
2026-05-18 21:51:22 -04:00
rootiest f09006846b fix(fzf): drop focus/resize bind entirely on older fzf builds
Older fzf (pre-0.62) does not support the focus and resize events in
bind actions, causing a startup error when --fish or the bundled
integration is sourced. Split the FZF_DEFAULT_OPTS preview block into
an if/else: newer fzf gets the dynamic bg-transform bind with wrap-word;
older fzf gets a static preview window with plain wrap and no event bind.
2026-05-18 21:47:20 -04:00
9 changed files with 455 additions and 52 deletions
+15
View File
@@ -241,6 +241,21 @@ rm -f file.txt # Falls through to standard rm -f
| `upgrade` | Full system upgrade: `paru -Syu --noconfirm` |
| `cleanup` | Log and remove orphaned packages |
### Dependency Management
`fish-deps` is a unified command for checking, installing, and updating all tools this config depends on.
| Command | Description |
|---|---|
| `fish-deps` / `fish-deps status` | Show installed/missing status for all deps, grouped by tier |
| `fish-deps install` | Interactively install each missing dep (prompts per-dep, prompts method when multiple exist) |
| `fish-deps update` | Update all installed deps using their preferred install method |
| `fish-deps sync` | Install missing deps then update installed ones |
| `fzf-update` | Install or upgrade fzf from git HEAD into `~/.fzf` (guarantees the latest build) |
| `check_fish_deps` | Legacy alias — delegates to `fish-deps status` |
Install method priority: **cargo** (for Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose.
### Docker
| Function | Description |
+52
View File
@@ -0,0 +1,52 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Populates parallel arrays describing every managed dependency.
# Callers must invoke this function before accessing _fdc_* variables.
#
# Array layout (same index across all sets):
# _fdc_bins — binary name (what `type -q` checks)
# _fdc_tiers — req | int | rec
# _fdc_cargo — cargo crate name, or "" if not on crates.io
# _fdc_pm — system PM package name, or "" if not in repos
# _fdc_special — special install key: fisher-bootstrap | fzf-update |
# paru-build | pipx | curl-installer | "" (none)
function _fish_deps_catalog
set -g _fdc_bins \
fish fisher starship fzf zoxide direnv paru \
wakatime tailscale \
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
set -g _fdc_tiers \
req req req req req req req \
int int \
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
set -g _fdc_cargo \
"" "" starship "" zoxide "" "" \
"" "" \
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trash-cli "" ""
set -g _fdc_pm \
fish "" starship fzf zoxide direnv paru \
wakatime tailscale \
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
set -g _fdc_special \
"" fisher-bootstrap curl-installer fzf-update "" "" paru-build \
pipx "" \
"" "" "" "" "" "" "" "" "" "" "" "" "" ""
end
# Returns the index (1-based) of $argv[1] in the catalog, or "" if not found.
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
+141
View File
@@ -0,0 +1,141 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Interactively install missing deps.
# For each missing dep: prompts yes/no, then prompts install method when multiple exist.
function _fish_deps_install
_fish_deps_catalog
set -l pm (_fish_deps_detect_pm)
set -l installed_any 0
set -l i 1
for bin in $_fdc_bins
if not type -q $bin
set -l cargo_crate $_fdc_cargo[$i]
set -l pm_pkg $_fdc_pm[$i]
set -l special $_fdc_special[$i]
# Build list of available install methods
set -l methods
set -l method_labels
# Cargo — only if cargo is present and the tool has a crate
if test -n "$cargo_crate" -a (type -q cargo)
set -a methods cargo
set -a method_labels "cargo ($cargo_crate)"
end
# System PM — only if a PM is detected and the tool is in repos
if test -n "$pm_pkg" -a -n "$pm"
set -a methods pm
set -a method_labels "$pm ($pm_pkg)"
end
# Special methods
switch $special
case fzf-update
set -a methods special-fzf
set -a method_labels "git clone (~/.fzf)"
case fisher-bootstrap
set -a methods special-fisher
set -a method_labels "curl bootstrap (fisher)"
case curl-installer
set -a methods special-curl
set -a method_labels "curl installer"
case paru-build
# Only useful on Arch; skip if pacman not present
if type -q yay
set -a methods special-yay-paru
set -a method_labels "yay -S paru"
end
if type -q pacman
set -a methods special-paru
set -a method_labels "build from AUR (makepkg)"
end
case pipx
if type -q pipx
set -a methods special-pipx
set -a method_labels "pipx ($bin)"
else if type -q pip
set -a methods special-pip
set -a method_labels "pip install --user ($bin)"
end
end
if test (count $methods) -eq 0
set_color yellow
echo " $bin: no install method available on this system — skipping"
set_color normal
set i (math $i + 1)
continue
end
# Prompt: install this dep?
set_color cyan; echo -n "Install $bin? "; set_color normal
read -l -P "[Y/n] " _reply
if test "$_reply" = n -o "$_reply" = N
set i (math $i + 1)
continue
end
# Choose install method
set -l chosen_method $methods[1]
if test (count $methods) -gt 1
echo " Available methods:"
set -l m 1
for lbl in $method_labels
echo " $m) $lbl"
set m (math $m + 1)
end
read -l -P " Choose [1-"(count $methods)"] (default 1): " _choice
if test -n "$_choice" -a "$_choice" -ge 1 -a "$_choice" -le (count $methods) 2>/dev/null
set chosen_method $methods[$_choice]
end
end
# Execute chosen method
switch $chosen_method
case cargo
cargo install $cargo_crate
case pm
_fish_deps_pm_install $pm_pkg
case special-fzf
fzf-update
case special-fisher
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source
fisher update
case special-curl
# Currently used for starship
if test "$bin" = starship
curl -sS https://starship.rs/install.sh | sh
end
case special-yay-paru
yay -S --noconfirm paru
case special-paru
set -l _build_dir (mktemp -d)
git clone https://aur.archlinux.org/paru.git $_build_dir
and pushd $_build_dir
and makepkg -si --noconfirm
and popd
rm -rf $_build_dir
case special-pipx
pipx install $bin
case special-pip
pip install --user $bin
end
if test $status -eq 0
set installed_any 1
set_color green; echo " $bin installed."; set_color normal
else
set_color red; echo " $bin install failed."; set_color normal
end
end
set i (math $i + 1)
end
if test $installed_any -eq 0
echo "Nothing to install."
end
end
+69
View File
@@ -0,0 +1,69 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Detect the first available system package manager.
function _fish_deps_detect_pm
for pm in paru yay pacman apt brew pkg dnf yum
if type -q $pm
echo $pm
return
end
end
echo ""
end
# Install a package via the system PM.
# Usage: _fish_deps_pm_install <pkg>
function _fish_deps_pm_install --argument-names pkg
set -l pm (_fish_deps_detect_pm)
if test -z "$pm"
echo "No supported package manager found." >&2
return 1
end
switch $pm
case paru
paru -S --noconfirm $pkg
case yay
yay -S --noconfirm $pkg
case pacman
sudo pacman -S --noconfirm $pkg
case apt
sudo apt install -y $pkg
case brew
brew install $pkg
case pkg
sudo pkg install -y $pkg
case dnf
sudo dnf install -y $pkg
case yum
sudo yum install -y $pkg
end
end
# Upgrade an already-installed package via the system PM.
# Usage: _fish_deps_pm_upgrade <pkg>
function _fish_deps_pm_upgrade --argument-names pkg
set -l pm (_fish_deps_detect_pm)
if test -z "$pm"
echo "No supported package manager found." >&2
return 1
end
switch $pm
case paru
paru -S --noconfirm $pkg
case yay
yay -S --noconfirm $pkg
case pacman
sudo pacman -S --noconfirm $pkg
case apt
sudo apt install --only-upgrade -y $pkg
case brew
brew upgrade $pkg
case pkg
sudo pkg upgrade -y $pkg
case dnf
sudo dnf upgrade -y $pkg
case yum
sudo yum update -y $pkg
end
end
+39
View File
@@ -0,0 +1,39 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Print colored installed/missing status for all deps, grouped by tier.
function _fish_deps_status
_fish_deps_catalog
function __fds_print_dep --argument-names bin tier
if type -q $bin
set_color green; echo -n " ✓ "; set_color normal
echo -n "$bin "
set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal
else if test "$tier" = rec
set_color yellow; echo -n " ⚠ "; set_color normal
echo -n "$bin "
set_color brblack; echo "(Not installed)"; set_color normal
else
set_color red; echo -n " ✗ "; set_color normal
echo -n "$bin "
set_color brblack; echo "(Not installed)"; set_color normal
end
end
for tier_label in "Required Dependencies:req" "Integrations:int" "Recommended Dependencies:rec"
set -l label (string split : $tier_label)[1]
set -l tier (string split : $tier_label)[2]
set_color cyan; echo $label; set_color normal
set -l i 1
for bin in $_fdc_bins
if test "$_fdc_tiers[$i]" = $tier
__fds_print_dep $bin $tier
end
set i (math $i + 1)
end
echo ""
end
functions -e __fds_print_dep
end
+84
View File
@@ -0,0 +1,84 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Update all installed deps using their known install method.
# Priority: cargo > system PM > special (fzf-update, fisher, pipx).
function _fish_deps_update
_fish_deps_catalog
set -l pm (_fish_deps_detect_pm)
set -l updated_any 0
# Fisher plugins — always update if fisher is present
if type -q fisher
echo "Updating fisher plugins..."
fisher update
set updated_any 1
end
set -l i 1
for bin in $_fdc_bins
# Skip fisher itself (handled above) and tools that aren't installed
if test "$bin" = fisher -o not (type -q $bin)
set i (math $i + 1)
continue
end
set -l cargo_crate $_fdc_cargo[$i]
set -l pm_pkg $_fdc_pm[$i]
set -l special $_fdc_special[$i]
# fzf: always use fzf-update (git-based)
if test "$special" = fzf-update
echo "Updating $bin..."
fzf-update
set updated_any 1
set i (math $i + 1)
continue
end
# pipx tools
if test "$special" = pipx
if type -q pipx
echo "Updating $bin..."
pipx upgrade $bin
set updated_any 1
end
set i (math $i + 1)
continue
end
# curl-installer tools (starship etc.): re-run install script, which upgrades in place
if test "$special" = curl-installer
if test "$bin" = starship
echo "Updating $bin..."
curl -sS https://starship.rs/install.sh | sh -- --yes
set updated_any 1
end
set i (math $i + 1)
continue
end
# Cargo: prefer for Rust tools
if test -n "$cargo_crate" -a (type -q cargo)
echo "Updating $bin..."
cargo install --force $cargo_crate
set updated_any 1
set i (math $i + 1)
continue
end
# System PM fallback
if test -n "$pm_pkg" -a -n "$pm"
echo "Updating $bin..."
_fish_deps_pm_upgrade $pm_pkg
set updated_any 1
end
set i (math $i + 1)
end
if test $updated_any -eq 0
echo "Nothing to update."
end
end
+2 -45
View File
@@ -1,50 +1,7 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Check all fish-related dependencies
# Thin wrapper kept for backwards compatibility.
function check_fish_deps --description 'Check all fish-related dependencies'
set -l required fish fisher starship fzf zoxide direnv paru
set -l integrations wakatime tailscale
set -l recommended eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
function __print_dep
set -l dep $argv[1]
if type -q $dep
set_color green
echo -n "  "
set_color normal
echo -n "$dep "
set_color brblack
echo "(Found at "(type -p $dep)")"
set_color normal
else
set_color red
echo -n "  "
set_color normal
echo -n "$dep "
set_color brblack
echo "(Not installed)"
set_color normal
end
end
set_color cyan; echo "Required Dependencies:"; set_color normal
for dep in $required
__print_dep $dep
end
echo ""
set_color cyan; echo "Integrations:"; set_color normal
for dep in $integrations
__print_dep $dep
end
echo ""
set_color cyan; echo "Recommended Dependencies:"; set_color normal
for dep in $recommended
__print_dep $dep
end
echo ""
functions -e __print_dep
fish-deps status
end
+41
View File
@@ -0,0 +1,41 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function fish-deps --description 'Manage fish shell dependencies'
set -l subcmd $argv[1]
switch $subcmd
case status ''
_fish_deps_status
case install
_fish_deps_install
case update
_fish_deps_update
case sync
echo "=== Installing missing deps ==="
_fish_deps_install
echo ""
echo "=== Updating installed deps ==="
_fish_deps_update
case '*'
set_color red
echo "Unknown subcommand: $subcmd"
set_color normal
echo ""
__fish_deps_help
return 1
end
end
function __fish_deps_help
set_color cyan; echo "fish-deps — manage fish shell dependencies"; set_color normal
echo ""
echo "Usage:"
echo " fish-deps [status] Check installed/missing deps (default)"
echo " fish-deps install Install missing deps interactively"
echo " fish-deps update Update all installed deps"
echo " fish-deps sync Install missing, then update all"
echo ""
echo "Install method priority: cargo > system PM > git/curl/pipx"
echo "When multiple methods are available, you will be prompted to choose."
end
+10 -5
View File
@@ -221,13 +221,18 @@ function fzf_key_bindings
end
# Prepend the options to allow user customizations
# wrap-word requires the same newer fzf as bg-transform; fall back to plain wrap
set -l _fzf_wrap_opt wrap
test "$_fzf_transform_action" = bg-transform; and set _fzf_wrap_opt wrap-word
if test "$_fzf_transform_action" = bg-transform
# Newer fzf: dynamic show/hide preview based on terminal width
set -p -- FZF_DEFAULT_OPTS \
'--bind="focus,resize:'$_fzf_transform_action':if test \\"$FZF_COLUMNS\\" -gt 100 -a \\\\( \\"$FZF_SELECT_COUNT\\" -gt 0 -o \\\\( -z \\"$FZF_WRAP\\" -a (string length -- {}) -gt (math $FZF_COLUMNS - 4) \\\\) -o (string collect -- {2..} | fish_indent | count) -gt 1 \\\\); echo show-preview; else echo hide-preview; end"' \
'--bind="focus,resize:bg-transform:if test \\"$FZF_COLUMNS\\" -gt 100 -a \\\\( \\"$FZF_SELECT_COUNT\\" -gt 0 -o \\\\( -z \\"$FZF_WRAP\\" -a (string length -- {}) -gt (math $FZF_COLUMNS - 4) \\\\) -o (string collect -- {2..} | fish_indent | count) -gt 1 \\\\); echo show-preview; else echo hide-preview; end"' \
'--preview="string collect -- (test \\"$FZF_SELECT_COUNT\\" -gt 0; and string collect -- {+2..}) \\"\\n# \\"'$date_cmd' {2..} | fish_indent --ansi"' \
'--preview-window="right,50%,'$_fzf_wrap_opt',follow,info,hidden"'
'--preview-window="right,50%,wrap-word,follow,info,hidden"'
else
# Older fzf: static preview; focus/resize events not reliably supported
set -p -- FZF_DEFAULT_OPTS \
'--preview="string collect -- (test \\"$FZF_SELECT_COUNT\\" -gt 0; and string collect -- {+2..}) \\"\\n# \\"'$date_cmd' {2..} | fish_indent --ansi"' \
'--preview-window="right,50%,wrap,follow,info"'
end
end
set -lx FZF_DEFAULT_OPTS_FILE