Skip to main content

Module logo

Module logo 

Source
Expand description

ASCII and graphical logo definitions and rendering.

Contains embedded distro logos and logic for rendering them as text or images (e.g., Sixel, Kitty, iTerm).

Structs§

LogoFit
The cell footprint of a logo, plus which dimension of the box it touches first.

Constants§

LOGO_MAX_COLS
Maximum width, in terminal columns, that a rendered logo may occupy.
LOGO_MAX_ROWS
Maximum height, in terminal rows, that a rendered logo may occupy.

Functions§

chafa_available
Checks if the chafa command-line tool is available in the system path.
chafa_size_arg
The --size WxH argument passed to chafa, derived from the shared logo cell box.
chafa_supports_probe
Checks if the chafa command-line tool supports the --probe option.
detect_distro
Attempts to detect the current operating system distribution.
fit_logo_cells
Fits an image into a cell box preserving its aspect ratio, returning a LogoFit.
get_ascii_logo
All ASCII logos are sourced from or compatible with Fastfetch.
get_chafa_logo_lines
Attempts to get Chafa output as a list of lines.
get_distro_colors
Returns dynamic ANSI color arrays for a given distribution.
get_distro_logo_lines
Interpolates placeholders ${1}${9} or $1$9 with dynamic ANSI colors and appends a reset at the end.
get_embedded_logo
Returns the raw PNG bytes for an embedded distro logo.
kitty_placement_spec
Builds the Kitty graphics-protocol placement keys (c= / r=) for a fitted logo.
logo_cells_for
Returns the cell footprint an image will occupy on the current terminal.
print_distro_logo
Print logo for a distro following the strict priority:
print_distro_logo_with_ascii
Renders the distribution logo with options to force ASCII or Chafa mode.
print_graphical_logo
Renders a raw image buffer using the Kitty graphics protocol.
print_graphical_logo_from_path
Loads an image from a file, resizes it, and prints it using the graphics protocol.
print_iterm2_logo
Renders a raw image buffer using the iTerm2 inline image protocol.
print_iterm2_logo_from_path
Loads an image from a file and prints it using the iTerm2 protocol.
print_sixel_logo
Renders a raw image buffer (e.g. PNG bytes) using the Sixel graphics protocol.
print_sixel_logo_from_path
Loads an image from a file, resizes it, and prints it using the Sixel protocol.
print_sixel_rgba
Renders raw RGBA pixels using the Sixel graphics protocol.
print_with_chafa
Attempts to render an image using the chafa utility.
supports_iterm2
Checks if the terminal supports the iTerm2 inline image protocol.
supports_kitty
Checks if the terminal supports the Kitty inline image protocol.
supports_sixel
Checks if the terminal supports Sixel graphics (heuristic based on environment).
terminal_cell_size_px
Returns the terminal cell size in pixels as (width, height) via TIOCGWINSZ.