Files
fish-config/functions/fish_right_prompt.fish
T
Claude fceddfc43f docs: add DEPENDENCIES sections to function doc headers
Documents what each function needs for full functionality -- other
repo functions it calls, and external CLI tools it uses or falls
back gracefully without (e.g. rm/trash, ls/eza+lsd) -- matching the
existing CLASSIFICATION convention's placement and the ~20 functions
that already carried this label.

Also broadens verify-manual.py's dependency-resolution check to
recognize this repo's other existence-check idioms (command -q,
command -v, which -- not just type -q) and dng2avif's dynamic
type -q $cmd loop, since several genuine dependencies (eza, lsd,
fastfetch, fd, ps, ...) are only ever guarded that way.
2026-09-22 22:22:27 -04:00

54 lines
1.5 KiB
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# CATEGORY
# 08-terminal-management
#
# COMPONENT
# overrides/prompt
#
# DEPENDENCIES
# docker, starship
#
# SYNOPSIS
# fish_right_prompt
#
# DESCRIPTION
# Renders the right-side prompt. Always shows a dim timestamp. When the last
# command failed, prefixes it with a red ✘ and the exit code. When docker
# and starship are both installed and C3 overrides are enabled, also shows
# the active Docker context (if non-default).
#
# EXIT STATUS
# 0 Always
#
# EXAMPLE
# # Rendered automatically by fish; not called directly.
function fish_right_prompt
set -l last_status $status
# Failed command: red ✘ + exit code; hidden when 0
if test $last_status -ne 0
set_color '#f38ba8'
echo -n "✘ $last_status "
set_color normal
end
# Docker context — only relevant alongside the starship prompt, and only
# when docker is actually installed (guarded like every other optional
# integration in this config).
if type -q docker; and type -q starship; and __fish_config_op_enabled (status current-function)
set -l docker_ctx (docker context show 2>/dev/null)
if test -n "$docker_ctx"; and test "$docker_ctx" != default
set_color blue
echo -n "󰡨 $docker_ctx "
set_color normal
end
end
# Timestamp — Catppuccin Overlay0 (dim)
set_color '#6c7086'
date "+%a %b %d %H:%M:%S %Y"
set_color normal
end