-
Notifications
You must be signed in to change notification settings - Fork 470
Configuration
Carter Li edited this page Aug 7, 2023
·
12 revisions
Fastfetch uses JSONC (JSON with comments) to store configuration. It should be located in ~/.config/fastfetch
, named config.jsonc
(NOT config.json
). You may create it with fastfetch --gen-config jsonc
. A simplest JSONC file should be like
// ~/.config/fastfetch/config.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"
}
Using an editor with JSON schema support is highly suggested. If unsure, I suggest using vscode.
We had command line, flag based configuration for long time, so bother introducing a new config format?
- JSON is standard. Most IDEs have builtin support of syntax highlighting, validation and formatting, without additional requirements.
- JSON is structure based. It's easier to read with proper indentation.
- With JSON schema, you get on-the-fly IDE intelligence when typing.
- JSON supports array. Print one module mutiple times without hacking the command line flags.
![image](https://private-user-images.githubusercontent.com/6134068/253265732-60159686-9b9f-4500-b87b-b5181279f7f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDUzNDYsIm5iZiI6MTczOTYwNTA0NiwicGF0aCI6Ii82MTM0MDY4LzI1MzI2NTczMi02MDE1OTY4Ni05YjlmLTQ1MDAtYjg3Yi1iNTE4MTI3OWY3ZjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDczNzI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzZmMzcyYWNkMjg4ZmRiMWRiOTFkOTIxZDQ2ODQ5YzIyZDlmYTQ3NzEyMTk4ZTRmZDM2YzQ4NjlhYTBmZTA1MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.-oz_U-OZP3Dfzi2onHJchz-q8NQOmmylnYg1R5nK8EU)
Refer to: https://github.com/fastfetch-cli/fastfetch/wiki/Json-Schema
Generated using json-schema-for-humans with
generate-schema-doc ~/fastfetch/doc/json_schema.json --config template_name=md Json-Schema.md
Also refer to fastfetch --help
for more detailed explanation.
- When
config.jsonc
is found,config.conf
will be ignored - Mixing command line flags with
config.jsonc
may / may not work. Generally, module command line option flags won't work whenconfig.jsonc
won't work. Other flags should work.