Advanced Usage

Benchmark Mode

The --benchmark flag displays timing information for the parallel probe phase and total execution:

xfetch --benchmark

Example output:

Parallel probes:   127ms
Total time:        189ms

Benchmark timing covers:

  • Parallel probes: GPU detection, package counting, and public IP fetching (run concurrently via thread::scope)
  • Total time: Entire execution including config loading, module gathering, rendering, and output

Cache System

xfetch caches certain data to improve performance on repeated runs.

Cache Storage

The cache is stored as a JSON file at:

PlatformPath
Linux~/.cache/xfetch/cache.json
macOS~/Library/Caches/xfetch/cache.json
Windows%LOCALAPPDATA%/xfetch/cache.json

Cached Data

DataTTLPurpose
Package counts5 minutesAvoid running multiple package manager commands
Public IP5 minutesAvoid repeated HTTP requests

Managing the Cache

# Clear all cached data
xfetch --clean-cache

Disabling the Cache

Set disable_cache: true in your configuration to disable caching entirely:

{
    "disable_cache": true
}

This is useful for environments where system state changes frequently or when you want the most current data on every run.

Privacy Controls

xfetch provides options to control network access and data collection.

Disabling Public IP Fetching

The public_ip module makes an HTTP request to an external service. To disable this for privacy:

{
    "disable_ip_fetching": true
}

When enabled, the public_ip module will return "Disabled" instead of attempting to fetch the IP address.

The plugin-based weather module also makes external API calls. To disable it, simply remove the plugin from your configuration.

Network Dependencies by Module

ModuleNetwork AccessExternal Service
public_ipYesifconfig.me, api.ipify.org, icanhazip.com
plugin:weatherYes (if installed)wttr.in
plugin:github-statsYes (if installed)api.github.com
All other modulesNoN/A

Cross-Platform Behavior

xfetch automatically adapts to the operating system.

Platform-Specific Module Behavior

ModuleLinuxmacOSWindows
GPUlspci -mmsystem_profiler SPDisplaysDataTypewmic or PowerShell
Battery/sys/class/power_supply/BAT*pmset -g battwmic path Win32_Battery
Shell$SHELL$SHELLParent process chain walk
Datetimedate commanddate commandPowerShell
Packagespacman, dpkg, rpm, flatpak, snap, apk, nix-envbrewscoop, winget
Config path~/.config/xfetch/~/Library/Application Support/xfetch/%APPDATA%/xfetch/
Cache path~/.cache/xfetch/~/Library/Caches/xfetch/%LOCALAPPDATA%/xfetch/
Binary namexfetch-plugin-<name>xfetch-plugin-<name>xfetch-plugin-<name>.exe

Fallback Chains

xfetch uses graceful fallback chains for platform-specific features:

  1. GPU detection: Primary command > fallback command > "Unknown"
  2. Battery detection: Primary path > fallback command > "N/A"
  3. Display resolution (plugin): xrandr > wlr-randr > xdpyinfo (Linux); system_profiler (macOS); PowerShell (Windows)
  4. Timezone (plugin): /etc/timezone > /etc/localtime symlink > timedatectl

Terminal Support

  • Color output: All ANSI-capable terminals
  • Image logos: iTerm2, Kitty, or Sixel-compatible terminals
  • ASCII logos: All terminals
  • Animation: Requires TTY. Falls back to static display in pipes or non-TTY contexts.

Daemon Mode

Daemon mode pins an animated fetch at the top of the terminal and keeps looping it in the background, so the shell prompt stays usable below it.

xfetch --daemon      # start the daemon
xfetch --daemon-stop # stop it

The animation only runs in TTY terminals; on pipes or redirects the static logo is shown. Daemon mode requires a logo_animation block with a plugin (e.g. animate-logo). In daemon mode the animation loops indefinitely — duration_ms and loop are ignored. To play a finite animation that stops on its own, keep daemon mode off.

Note: Both the animated daemon and the live stats daemon are Unix-only (Linux/macOS). On Windows they are not supported and print an error message.

Live Stats Daemon

The live stats daemon (daemon_live) pins a fetch block at the top of the terminal and re-probes a lightweight module subset every daemon_live_refresh seconds. It is a sibling of the animated daemon above — the existing animated daemon is untouched. Config keys: daemon_live, daemon_live_refresh, daemon_live_modules, daemon_live_reload (hot-reload the config and the active theme).

xfetch --no-daemon-live     # disable the live daemon even if enabled in config
xfetch --daemon-live-stop   # stop the running live daemon
xfetch --daemon-live-reload # force hot reload

WSL Presentation

On Windows Subsystem for Linux, the OS line can be decorated with WSL details via os_wsl_style (Linux only):

ValueBehavior
offPlain OS name, no decoration
minimalAppends (WSL) (default)
fullAppends the WSL version and WSLg if present

Intro Effects

xfetch effects installs, lists, and removes intro effects that animate the content lines when the fetch starts. The effects config key (a single effect or a list) selects which effects play and in what order:

xfetch effects install <name>   # install an effect
xfetch effects list             # list installed effects
xfetch effects remove <name>    # remove an effect
{
    "effects": {
        "plugin": "decrypt",
        "duration_ms": 1500,
        "fps": 30
    }
}

See the Effects page for the full protocol, configuration fields, and how to write custom effects.

Performance Optimization

xfetch employs several performance optimizations:

Parallel Probing

The following probes run concurrently using Rust's thread::scope:

  • GPU detection
  • Package counting
  • Public IP fetching

This reduces total execution time by running I/O-bound operations in parallel.

Lazy Initialization

System resources are initialized only when the corresponding module is requested:

  • sysinfo::System (CPU, memory, disks, networks) -- initialized lazily
  • sysinfo::Disks -- initialized only if a disk module is configured
  • sysinfo::Networks -- initialized only if a network module is configured
  • sysinfo::Components -- initialized only if temperature modules were configured

Caching

Package counts and public IP lookups are cached with TTLs to avoid redundant system calls and network requests.

Environment Variables Reference

VariableDescriptionUsed By
USER / LOGNAMECurrent usernameCore modules (user)
SHELLCurrent shell pathCore modules (shell)
HOMEHome directory pathCore modules, plugin discovery
TERM_PROGRAMTerminal emulator nameCore modules (terminal)
TERMTerminal typeCore modules (terminal)
WT_SESSIONWindows Terminal sessionCore modules (terminal)
XDG_CURRENT_DESKTOPDesktop environmentCore modules (wm)
DESKTOP_SESSIONDesktop session nameCore modules (wm)
XFETCH_PLUGIN_REPOPlugin repository URLPlugin installation
XFETCH_PLUGIN_DEV_DIRPlugin development directoryPlugin discovery
GITHUB_USERGitHub usernamegithub-stats plugin
CARGO_NET_GIT_FETCH_WITH_CLIForce git CLI fetchPlugin builds