This page provides a comprehensive introduction to fastfetch, its architecture, and core capabilities. It covers the fundamental design patterns, main components, and execution model of the application. For detailed information about specific subsystems, refer to:
Fastfetch is a neofetch-like system information tool written primarily in C, with a focus on performance and customizability README.md1-16 It detects and displays hardware and software information about the host system in a visually formatted output.
Key Characteristics:
| Aspect | Description |
|---|---|
| Language | C (mainly) CMakeLists.txt5 |
| Platforms | Linux, macOS, Windows 8.1+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, SunOS README.md16 CHANGELOG.md4-5 |
| License | MIT License CMakeLists.txt10 |
| Configuration | JSONC (JSON with comments) README.md106 |
| Output Formats | Human-readable text with ANSI colors, JSON for machine consumption src/fastfetch.c18-53 |
Sources: README.md1-16 CMakeLists.txt1-10 src/fastfetch.c18-53 CHANGELOG.md1-5
The fastfetch application is built around a single global instance structure FFinstance that holds all configuration and state.
Data Structure Hierarchy
The FFinstance structure is defined in src/fastfetch.h41-45 and the global variable instance is declared as extern in src/fastfetch.h46
FFconfig: Holds user-configurable options managed via FFOptionsLogo, FFOptionsDisplay, and FFOptionsGeneral src/fastfetch.h23-28FFstate: Maintains runtime state information, including the detected FFPlatform and terminal properties src/fastfetch.h30-39Sources: src/fastfetch.h23-46
The application follows an initialization, execution, and cleanup lifecycle. In fastfetch.c, the process typically involves:
ffInitInstance() sets up the global instance src/flashfetch.c10ffStart() prepares the environment src/flashfetch.c20ffLogoPrint() displays the ASCII or image logo src/flashfetch.c23ffPrintCPU, ffPrintGPU) src/flashfetch.c29-141ffFinish() and ffDestroyInstance() restore the terminal and free resources src/flashfetch.c144-145Sources: src/flashfetch.c8-147
Fastfetch implements a modular system where each piece of information (CPU, OS, etc.) is handled by a specific module.
Modules are registered in a global array ffModuleInfos src/fastfetch.h47 Each module is described by a FFModuleBaseInfo structure which contains its name and formatting arguments src/fastfetch.c28-33
Module Mapping
Fastfetch supports over 70 modules including Battery, CPU, Disk, GPU, Memory, OS, Packages, and Shell src/modules/modules.h1-77
Sources: src/fastfetch.h47 src/modules/modules.h1-77 src/fastfetch.c28-33
Fastfetch achieves cross-platform support by providing platform-specific implementations for a common detection interface. The build system detects the platform using CMAKE_SYSTEM_NAME CMakeLists.txt28-50
| Platform | Detection Implementation Scope |
|---|---|
| Linux | GNU/Linux and Kernel-specific logic CMakeLists.txt28-29 |
| macOS | Apple Darwin specific APIs CMakeLists.txt48 CHANGELOG.md109 |
| Windows | Windows 8.1 and later CMakeLists.txt109 CHANGELOG.md4-5 |
| BSD | FreeBSD, OpenBSD, NetBSD, DragonFly CMakeLists.txt30-41 |
| Other | Android, SunOS (Solaris), Haiku, GNU (Hurd) CMakeLists.txt42-47 CHANGELOG.md67-70 |
Sources: CMakeLists.txt28-50 CHANGELOG.md4-70
The build process is managed by CMake CMakeLists.txt3 It uses a series of cmake_dependent_option and option flags to enable or disable features based on the target platform and available libraries.
PkgConfig to find dependencies like vulkan, wayland, or dbus CMakeLists.txt59-80ENABLE_EMBEDDED_PCIIDS allow embedding hardware databases directly into the binary CMakeLists.txt104BUILD_FLASHFETCH option controls whether the faster, neofetch-compatible variant is built CMakeLists.txt99Sources: CMakeLists.txt1-104
Fastfetch is designed for both visual appeal and programmatic use.
{name}, {version}) src/fastfetch.c38-43yyjson for integration with other scripts src/fastfetch.c18-53Sources: src/fastfetch.c18-53 README.md108
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.