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
chafacommand-line tool is available in the system path. - chafa_
size_ arg - The
--size WxHargument passed tochafa, derived from the shared logo cell box. - chafa_
supports_ probe - Checks if the
chafacommand-line tool supports the--probeoption. - 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…$9with 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
chafautility. - 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)viaTIOCGWINSZ.