This page documents fastfetch's global display configuration for formatting temperatures and various unit types (sizes, frequencies, fractions, durations). These settings control how numeric values with units are displayed across all modules.
For information about percentage formatting and progress bars, see 4.3.1 Percentage and Bar Display For the general format string system used by individual modules, see 4.2 Format String Engine and Output Printing
Fastfetch provides centralized formatting options for common numeric types that appear across multiple modules. These global settings ensure consistent presentation while allowing per-module overrides. The formatting system handles:
All formatting options support a "space before unit" configuration to control whether units like "°C", "GiB", or "GHz" have a space before them.
Sources: src/options/display.h1-103 src/options/display.c1-162
The formatting configuration is stored within the FFOptionsDisplay structure and is populated during the initialization and configuration parsing phases.
The following diagram illustrates how configuration flows from input sources into the internal FFOptionsDisplay structure and is subsequently used by formatting utilities and modules.
Sources: src/options/display.h37-96 src/options/display.c10-162 src/common/temps.h1-10
Temperature values are detected by hardware modules and formatted according to global temperature display options. The system supports unit conversion, precision control, and threshold-based color coding.
The FFTemperatureUnit enum defines the available temperature scales.
| Enum Value | JSON/CLI Value | Description |
|---|---|---|
FF_TEMPERATURE_UNIT_DEFAULT | "DEFAULT" | Uses module-specific default or Celsius |
FF_TEMPERATURE_UNIT_CELSIUS | "CELSIUS" | Degrees Celsius |
FF_TEMPERATURE_UNIT_FAHRENHEIT | "FAHRENHEIT" | Degrees Fahrenheit |
FF_TEMPERATURE_UNIT_KELVIN | "KELVIN" | Kelvin |
Sources: src/options/display.h15-21 src/options/display.c172-185
Temperature colors are applied based on thresholds defined in Celsius. The function ffTempsAppendNum handles the logic for choosing the correct color based on whether the current temperature is below the green threshold or between green and yellow.
Sources: src/common/temps.h6 src/options/display.h65-67 doc/json_schema.json105-116
Size values (memory, disk space) are formatted using binary prefixes. Fastfetch supports three systems defined in FFSizeBinaryPrefixType.
| Prefix Type | Divisor | Unit Notation | Example |
|---|---|---|---|
| IEC | 1024 | KiB, MiB, GiB, ... | FF_SIZE_BINARY_PREFIX_TYPE_IEC |
| SI | 1000 | kB, MB, GB, ... | FF_SIZE_BINARY_PREFIX_TYPE_SI |
| JEDEC | 1024 | KB, MB, GB, ... | FF_SIZE_BINARY_PREFIX_TYPE_JEDEC |
Sources: src/options/display.h8-13 src/options/display.c124-136
The sizeMaxPrefix option (type uint8_t) limits the largest unit used. It is parsed as an enum from "B" (0) to "YB" (8).
| Value | Unit | Description |
|---|---|---|
| 0 | B | Bytes |
| 1 | kB/KiB | Kilobytes |
| 3 | GB/GiB | Gigabytes |
| 8 | YB/YiB | Yottabytes |
Sources: src/options/display.c104-122 src/options/display.h61
CPU and GPU frequencies are typically formatted in GHz.
freqNdigits: Number of decimal places src/options/display.h90freqSpaceBeforeUnit: Controls spacing before "GHz" src/options/display.h91General decimal numbers use fractionNdigits and fractionTrailingZeros.
| Trailing Zeros Type | Enum Value | Description |
|---|---|---|
| Default | FF_FRACTION_TRAILING_ZEROS_TYPE_DEFAULT | Module default |
| Always | FF_FRACTION_TRAILING_ZEROS_TYPE_ALWAYS | Keep zeros (e.g., 3.50) |
| Never | FF_FRACTION_TRAILING_ZEROS_TYPE_NEVER | Remove zeros (e.g., 3.5) |
Sources: src/options/display.h30-35 src/options/display.h92-93 src/options/display.c481-515
The FFSpaceBeforeUnitType enum is used globally to standardize whether a space exists between a numeric value and its unit string.
| Value | Behavior |
|---|---|
FF_SPACE_BEFORE_UNIT_DEFAULT | Uses module/type specific default |
FF_SPACE_BEFORE_UNIT_ALWAYS | Always inserts a space (e.g., "60 °C") |
FF_SPACE_BEFORE_UNIT_NEVER | Never inserts a space (e.g., "60°C") |
This is applied to:
tempSpaceBeforeUnit src/options/display.h68sizeSpaceBeforeUnit src/options/display.h62freqSpaceBeforeUnit src/options/display.h91percentSpaceBeforeUnit src/options/display.h84durationSpaceBeforeUnit src/options/display.h57Sources: src/options/display.h23-28 src/options/display.c149-161
While global settings exist in FFOptionsDisplay, individual modules can have their own FFPercentageModuleConfig or FFColorRangeConfig.
For example, the GPU module uses FFGPUOptions which embeds specific configurations:
These per-module settings are parsed using:
ffTempsParseJsonObject src/common/temps.h8ffPercentParseJsonObject src/common/percent.h43Sources: src/modules/gpu/option.h23-33 src/common/percent.h19-24
Refresh this wiki