Configuration

xfetch uses a JSONC (JSON with Comments) configuration file. The default location is ~/.config/xfetch/config.jsonc. You can generate a default configuration with xfetch --gen-config or use a custom path with xfetch --config <path>.

Config File Format

JSONC extends standard JSON by allowing C-style (//) and C++-style (/* */) comments and trailing commas in objects and arrays.

Complete Configuration Reference

{
    "layout": "section",
    "modules": [
        {
            "type": "group",
            "title": "Hardware",
            "modules": [
                "hostname",
                "cpu",
                "gpu",
                "memory",
                "swap",
                "disk",
                "battery"
            ]
        },
        {
            "type": "group",
            "title": "Software",
            "modules": [
                "os",
                "kernel",
                "packages",
                "shell",
                "wm",
                "terminal",
                "local_ip"
            ]
        },
        "palette"
    ],
    "show_colors": true,
    "icons": {
        "hostname": "\uf109",
        "cpu": "\uf2db",
        "gpu": "\uf0b9"
    },
    "colors": {
        "hostname": "Green",
        "cpu": "Green",
        "os": "Yellow"
    },
    "palette_style": "squares",
    "logo_path": null,
    "ascii": null,
    "header_icons": null,
    "footer_text": null,
    "disable_ip_fetching": false,
    "disable_cache": false,
    "logo_animation": null,
    "info_plugins": []
}

Field Reference

Top-Level Fields

FieldTypeDefaultDescription
layoutstring or nullnull (classic)Layout style name
modulesarray(see below)Ordered list of modules or module groups
show_colorsbooleantrueEnable ANSI color output
iconsobject(built-in defaults)Per-module icon mappings
colorsobject(built-in defaults)Per-module color mappings
palette_stylestring"squares"Palette display style
logo_pathstring or nullnullPath to a custom logo file
asciistring or nullnullPath to an ASCII art file (alternative to logo_path)
header_iconsarray or nullnullIcons for the top border (Pac-Man layout)
footer_textstring or nullnullText for the bottom border (Pac-Man layout)
disable_ip_fetchingbooleanfalseDisable fetching public IP for privacy
disable_cachebooleanfalseDisable data caching
logo_animationobject or nullnullLogo animation configuration
info_pluginsarray[]List of info plugins to execute

Default Modules

When no modules are specified, xfetch uses:

["os", "kernel", "uptime", "packages", "wm", "shell", "disk", "cpu", "gpu", "memory", "battery"]

Module Groups

Modules can be organized into titled groups for the section, tree, and side-block layouts:

{
    "type": "group",
    "title": "Hardware",
    "modules": ["cpu", "gpu", "memory"]
}

Groups can be nested:

{
    "type": "group",
    "title": "System",
    "modules": [
        {
            "type": "group",
            "title": "Hardware",
            "modules": ["cpu", "gpu"]
        },
        {
            "type": "group",
            "title": "Software",
            "modules": ["os", "kernel"]
        }
    ]
}

Icons

Icons map module names to display strings. Nerd Font glyphs are commonly used, but any Unicode or text string works.

{
    "icons": {
        "os": "\uf17c",
        "kernel": "\uf17c",
        "hostname": "\uf109",
        "cpu": "\uf2db",
        "gpu": "\uf0b9",
        "memory": "\ue266",
        "swap": "\uf0c5",
        "disk": "\uf0a0",
        "battery": "\uf240",
        "uptime": "\uf253",
        "packages": "\uf187",
        "shell": "\uf0e7",
        "terminal": "\uf0e7",
        "wm": "\uf08e",
        "user": "\uf007",
        "datetime": "\uf017",
        "local_ip": "\uf0ac",
        "palette": "\uf0eb",
        "plugin:<name>": "\uf271"
    }
}

Module keys prefixed with plugin: (e.g., plugin:docker) are used for plugin-provided information.

Colors

Colors map module names to ANSI color names:

{
    "colors": {
        "os": "Cyan",
        "kernel": "White",
        "wm": "Blue",
        "shell": "Green",
        "cpu": "Green",
        "gpu": "Green",
        "memory": "Green",
        "disk": "Green",
        "battery": "Green",
        "packages": "Yellow",
        "hostname": "Green",
        "uptime": "Yellow",
        "terminal": "Green",
        "user": "Magenta"
    }
}

Available color names:

NameANSI Code
Black30
Red31
Green32
Yellow33
Blue34
Magenta35
Cyan36
White37
Grey or Gray90

Palette Styles

The palette module displays a color swatch. Available styles:

StyleDescription
"squares"Background color blocks (default)
"circles"Foreground color circles
"triangles"Foreground color triangles
"lines"Thick horizontal color bars
"dots"Small foreground color dots

Animation Configuration

The logo_animation field enables ASCII logo animation via a plugin:

{
    "logo_animation": {
        "plugin": "animate-logo",
        "fps": 12,
        "duration_ms": 1200,
        "loop": false,
        "style": "sweep",
        "frames_path": "~/.config/xfetch/logos/frames.txt"
    }
}
FieldTypeDescription
pluginstringPlugin name (e.g., "animate-logo")
fpsnumberFrames per second (1-60)
duration_msnumberTotal animation duration in milliseconds
loopbooleanWhether to loop the animation
stylestringAnimation style: "sweep", "wave", "rainbow", "sparkle", "breathing", "frame", "none"
frames_pathstringPath to pre-built frame sets (for "frame" style). Multiple frame sets separated by \n===\n

Plugin Integration

Info plugins are configured in the info_plugins array:

{
    "info_plugins": [
        {
            "plugin": "github-stats",
            "args": {
                "username": "myuser",
                "max_lines": 3
            }
        },
        {
            "plugin": "docker"
        }
    ]
}
FieldTypeDescription
pluginstringPlugin name (installed as xfetch-plugin-<name>)
argsobject or nullArbitrary JSON arguments passed to the plugin

Plugin data is accessed via module keys prefixed with plugin::

{
    "modules": ["os", "kernel", "plugin:github-stats", "plugin:docker"]
}

Config File Locations by Platform

PlatformDefault Config Path
Linux~/.config/xfetch/config.jsonc
macOS~/Library/Application Support/xfetch/config.jsonc
Windows%APPDATA%\xfetch\config.jsonc