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:
thread::scope)xfetch caches certain data to improve performance on repeated runs.
The cache is stored as a JSON file at:
| Platform | Path |
|---|---|
| Linux | ~/.cache/xfetch/cache.json |
| macOS | ~/Library/Caches/xfetch/cache.json |
| Windows | %LOCALAPPDATA%/xfetch/cache.json |
| Data | TTL | Purpose |
|---|---|---|
| Package counts | 5 minutes | Avoid running multiple package manager commands |
| Public IP | 5 minutes | Avoid repeated HTTP requests |
# Clear all cached data
xfetch --clean-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.
xfetch provides options to control network access and data collection.
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.
| Module | Network Access | External Service |
|---|---|---|
public_ip | Yes | ifconfig.me, api.ipify.org, icanhazip.com |
plugin:weather | Yes (if installed) | wttr.in |
plugin:github-stats | Yes (if installed) | api.github.com |
| All other modules | No | N/A |
xfetch automatically adapts to the operating system.
| Module | Linux | macOS | Windows |
|---|---|---|---|
| GPU | lspci -mm | system_profiler SPDisplaysDataType | wmic or PowerShell |
| Battery | /sys/class/power_supply/BAT* | pmset -g batt | wmic path Win32_Battery |
| Shell | $SHELL | $SHELL | $PSModulePath check |
| Datetime | date command | date command | PowerShell |
| Packages | pacman, dpkg, rpm, flatpak, snap, apk, nix-env | brew | scoop, choco |
| Config path | ~/.config/xfetch/ | ~/Library/Application Support/xfetch/ | %APPDATA%/xfetch/ |
| Cache path | ~/.cache/xfetch/ | ~/Library/Caches/xfetch/ | %LOCALAPPDATA%/xfetch/ |
| Binary name | xfetch-plugin-<name> | xfetch-plugin-<name> | xfetch-plugin-<name>.exe |
xfetch uses graceful fallback chains for platform-specific features:
/etc/timezone > /etc/localtime symlink > timedatectlxfetch employs several performance optimizations:
The following probes run concurrently using Rust's thread::scope:
This reduces total execution time by running I/O-bound operations in parallel.
System resources are initialized only when the corresponding module is requested:
sysinfo::System (CPU, memory, disks, networks) -- initialized lazilysysinfo::Disks -- initialized only if a disk module is configuredsysinfo::Networks -- initialized only if a network module is configuredsysinfo::Components -- initialized only if temperature modules were configuredPackage counts and public IP lookups are cached with TTLs to avoid redundant system calls and network requests.
| Variable | Description | Used By |
|---|---|---|
USER / LOGNAME | Current username | Core modules (user) |
SHELL | Current shell path | Core modules (shell) |
HOME | Home directory path | Core modules, plugin discovery |
TERM_PROGRAM | Terminal emulator name | Core modules (terminal) |
TERM | Terminal type | Core modules (terminal) |
WT_SESSION | Windows Terminal session | Core modules (terminal) |
XDG_CURRENT_DESKTOP | Desktop environment | Core modules (wm) |
DESKTOP_SESSION | Desktop session name | Core modules (wm) |
XFETCH_PLUGIN_REPO | Plugin repository URL | Plugin installation |
XFETCH_PLUGIN_DEV_DIR | Plugin development directory | Plugin discovery |
GITHUB_USER | GitHub username | github-stats plugin |
CARGO_NET_GIT_FETCH_WITH_CLI | Force git CLI fetch | Plugin builds |