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 — without splits or an extra terminal multiplexer.

How it works

When daemon mode is active, xfetch forks to the background: the parent writes its PID to ~/.config/xfetch/daemon.pid and exits immediately, so the shell prompt returns instantly. The child keeps rendering the animation loop pinned at the top of the terminal, reserving the top rows with a terminal scroll region (DECSTBM) and drawing each frame with absolute cursor positioning.

No extra shell configuration is required — everything activates from the JSON.

On Windows there is no fork: the parent renders the first frame and spawns a worker copy of itself that inherits the console, and xfetch --daemon-stop signals a named stop event (falling back to terminating the worker) so the terminal is restored either way. The worker also exits on its own when the shell leaves the console — the Windows equivalent of the pty hangup. Scroll region, absolute rows and cursor save/restore are the same on every platform.

Activation

From the CLI:

xfetch --daemon

Or from the config file:

{
    "daemon": true,
    "logo_animation": {
        "plugin": "animate-logo",
        "style": "frame",
        "fps": 6,
        "frames_path": "~/.config/xfetch/logos/fox.txt"
    }
}

The --daemon CLI flag overrides the daemon config value.

Stopping the daemon

xfetch --daemon-stop

This reads the PID from ~/.config/xfetch/daemon.pid, verifies it is an xfetch process, sends SIGTERM, and restores the terminal (cursor shown, scroll region reset, PID file removed).

On Windows the same command signals the worker's named stop event instead of SIGTERM; if the worker does not exit within a second it is terminated and the terminal is restored from the stop command. The PID is validated against the process image name (xfetch.exe), mirroring the /proc/<pid>/comm check on Linux.

Configuration

FieldTypeDefaultDescription
daemonbooleanfalse Enable daemon mode.
daemon_min_rowsnumber6 Minimum number of terminal rows left free below the pinned block for command output.

Behavior details

Terminal height

Tall figures (e.g. cat ~29 rows, matrix ~24 rows) take up almost a whole 30-row terminal and leave little room for command output. The daemon reserves the top rows for the logo and keeps command output in the remaining height below it. Medium-height figures (~13-17 rows) are recommended for standard terminals.

Notes & troubleshooting

Live Stats Daemon

The live stats daemon (daemon_live) is a sibling of the animated-logo daemon: it pins the fetch block at the top of the terminal and re-probes a lightweight subset of modules every few seconds, re-rendering the block with fresh values (cpu, memory, swap, disk, battery, uptime, datetime). Your fetch stops being a static snapshot and becomes a live panel — think "conky pinned at the top", not an interactive btop.

The existing animated daemon is untouched: the two modes are independent and share the same pinning/scroll-region machinery.

Activation

{
    "daemon_live": true,
    "daemon_live_refresh": 2
}

Activation is config-only; the terminal flags only disable/stop/force:

xfetch --no-daemon-live       # disable even if the config enables it
xfetch --daemon-live-stop     # stop the running live daemon
xfetch --daemon-live-reload   # force hot reload (same as "daemon_live_reload": true)

Configuration

FieldTypeDefaultDescription
daemon_livebooleanfalse Enable the live stats daemon.
daemon_live_refreshnumberper-platform Seconds between refreshes. Defaults to the platform policy (platform/<os>/live.rs): Linux 2, macOS 3, Windows 5.
daemon_live_modulesarrayper-platform Modules shown (and refreshed). Defaults to the platform's live set: Linux/macOS cpu, memory, swap, disk, battery, uptime, datetime; Windows excludes battery (opt-in) unless you add it back.
daemon_live_reloadbooleanfalse Hot reload: watch the config file (and the active theme) and re-apply changes — modules, colors, icons, layout, logo, refresh cadence — without restarting the daemon. Equivalent CLI flag: --daemon-live-reload.

Behavior details