Skip to content

Commit 66ba5d0

Browse files
committed
Doc: document named placeholders
1 parent 983e5c6 commit 66ba5d0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ Features:
66
* Apply default color palettes in `--file` and `--data` (Logo)
77
* Print all presets in `--list-presets` for better Windows support (Windows)
88
* Support for guix package manager detection (Packages, Linux)
9-
* Support named module output formatting placeholders (#796)
10-
* Besides the meaningless `--title-format '{6}{7}{8}'`, `--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'` is now supported
9+
* Support named variable placeholders in custom module formattion string (#796)
10+
* `--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'` is equivalent to `--title-format '{6}{7}{8}'`
11+
* Support named color placeholders in custom module formattion string
12+
* `--<module>-format '{#red}'` is equivalent to `--<module>-format '{#31}'`
13+
* `'{#red}'` or `'{#31}'` is preferred over `\u001b[31m` because is more readable and `--pipe` aware (will be ignored in pipe mode)
14+
* Supported in `Custom` module too
15+
* See `fastfetch -h format` for detail
16+
* Add option `--color-separator` to set the color of key-value separators
1117

1218
Bugfixes:
1319
* Don't detect `.conf` files in `--list-config-paths`
1420
* Don't try to detect terminals in MSYS shell with process backtracing (Windows)
21+
* Fix `outputColor` doesn't work if module keys are disabled
1522

1623
Logos:
1724
* Add Cereus Linux

src/data/help_format.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ For example the format string "Values: {1} ({2})", with the values "First" and "
44
The format string can contain placeholders in any order and have multiple occurrences.
55
To include spaces when setting from the command line, surround the whole string with double quotes (").
66

7+
In 2.14.0 or newer, the value indices can be meaningful named tags.
8+
For example: "--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'" is equivalent to "--title-format '{6}{7}{8}'"
9+
See "fastfetch -h title-format" for all supported tags.
10+
711
If the value index is missing, meaning the placeholder is "{}", an internal counter sets the value index.
812
This means that the format string "Values: {1} ({2})" is equivalent to "Values: {} ({})".
913
Note that this counter only counts empty placeholders, so the format string "{2} {} {}" will contain the second value, then the first, and then the second again.
@@ -24,7 +28,7 @@ To stop formatting at any point in the format string, use "{-}".
2428
To print something with color, start a placeholder with a '#' and then the linux terminal color encoding.
2529
"\033[" at the start, and an 'm' at the end is automatically added, so don't do that.
2630
A "{#}" is equivalent to a "{#0}" and resets everything to normal.
27-
For example to print something pink and underline, use "{#4;35}...{#}". "{#underline_magenta}" is also supported.
31+
For example to print something pink and underline, use "{#4;35}...{#}". "{#underline_magenta}" is also supported. See `fastfetch -h color` for detail.
2832
Information about what the numbers mean can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
2933
Which escape codes are supported and how they look is defined by your terminal.
3034

0 commit comments

Comments
 (0)