xfetch Config Generation (--gen-config)

xfetch --gen-config generates a starter config file so you can run and customize xfetch without hand-writing one. It writes a ready-to-use template and, when network is available, attaches the ASCII logo of your OS/distro.

Basic Usage

Generate the config at the default location (~/.config/xfetch/config.jsonc on Linux, ~/Library/Application Support/xfetch/config.jsonc on macOS, %APPDATA%\xfetch\config.jsonc on Windows):

xfetch --gen-config

Generate it somewhere else:

xfetch --gen-config --config ~/my-setup/xfetch-config.jsonc

Distro Logo (--logo)

By default the generated config includes the ASCII logo of the detected OS/distro, fetched from the xfetch-cli/logos catalog.

Automatic Detection

The detection reads /etc/os-release (ID + ID_LIKE) on Linux, and maps the OS version on macOS (macos-ventura, ...) and Windows (windows-11, ...). Resolution order: exact ID → each ID_LIKE token → generic logo of the category.

The fetched art is stored in <config_dir>/xfetch/logos/<distro-id>.txt and the generated config references it via the ascii key:

{
    "ascii": "/home/jan/.config/xfetch/logos/ubuntu.txt",
    "layout": "section",
    // ...
}

Logo Override

Choose a specific logo with --logo, overriding the detected OS/distro. Any catalog id or alias works, including logos of other OSes:

# Ubuntu machine, Arch logo
xfetch --gen-config --logo arch

# Force a specific OS/version logo
xfetch --gen-config --logo windows-11
xfetch --gen-config --logo macos-ventura

Fallbacks

The catalog base URL can be overridden for testing forks or mirrors:

XFETCH_LOGOS_URL=https://raw.githubusercontent.com/<user>/logos/main \
    xfetch --gen-config --logo arch

Layout (--layout)

The template ships with the section layout (grouped Hardware/Software/Session modules). Use --layout to generate it with any of the built-in layouts (see LAYOUTS.md). Run xfetch --list-layouts to print every accepted name:

xfetch --gen-config --layout pacman
xfetch --gen-config --layout tree
xfetch --gen-config --layout compact

Available layout names:

An unknown layout name warns and keeps section.

Combined Example

Generate a tree-layout config with the Arch logo on an Ubuntu machine:

xfetch --gen-config --layout tree --logo arch --config ~/configs/arch-tree.jsonc

The --logo and --layout flags only apply to --gen-config; runtime behavior is untouched.