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.
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-configGenerate it somewhere else:
xfetch --gen-config --config ~/my-setup/xfetch-config.jsoncBy default the generated config includes the ASCII logo of the detected OS/distro, fetched from the xfetch-cli/logos catalog.
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": "pacman",
// ...
}
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-
Unknown
--logoid: warns and uses the generic logo of the current category, saved asdefault.txt. -
No network / catalog error / invalid art: the template is written without
a logo — the previous behavior. Automatic detection falls back silently; an explicit
--logoprints a warning. -
Offline cache: once a logo is downloaded it stays in
<config_dir>/xfetch/logos/, so regenerating later references the same file even without internet.
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
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):
xfetch --gen-config --layout pacman
xfetch --gen-config --layout tree
xfetch --gen-config --layout compactAvailable layout names:
default,side-block,tree,section,section-boxcustom-x,compact,minimalpacman,box,line,dots,bottom_line(classic variants)horizontal,bottom(vertical layouts)
An unknown layout name warns and keeps pacman.
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.