JsonConfig: update json_schema, and move it to doc. Move logo.md to Github wiki

This commit is contained in:
李通洲
2023-06-21 16:33:46 +08:00
committed by 李通洲
parent 5b5527f4c9
commit 9ddec1d9aa
3 changed files with 178 additions and 350 deletions
+993
View File
@@ -0,0 +1,993 @@
{
"$schema": "http://json-schema.org/schema",
"$defs": {
"colors": {
"type": "string",
"enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"]
},
"key": {
"title": "Key of the module",
"type": "string"
},
"keyColor": {
"title": "Color of the module key. Left empty to use `display.color.keys`",
"$ref": "#/$defs/colors"
},
"format": {
"title": "Output format of the module",
"type": "string"
}
},
"type": "object",
"title": "JSON config file for fastfetch. Usually be `~/.config/fastfetch.jsonc`",
"properties": {
"$schema": {
"type": "string",
"title": "JSON schema URL",
"format": "uri"
},
"logo": {
"title": "Fastfetch logo configurations",
"type": "object",
"properties": {
"type": {
"title": "Set the type of the logo given",
"enum": [
"auto",
"builtin",
"file",
"file-raw",
"data",
"data-raw",
"sixel",
"kitty",
"iterm",
"chafa",
"raw",
"none"
],
"default": "auto"
},
"source": {
"type": "string",
"title": "Set the source file of the logo"
},
"color": {
"type": "object",
"title": "Overwrite a color in the logo",
"properties": {
"1": {
"title": "Color 1",
"$ref": "#/$defs/colors"
},
"2": {
"title": "Color 2",
"$ref": "#/$defs/colors"
},
"3": {
"title": "Color 3",
"$ref": "#/$defs/colors"
},
"4": {
"title": "Color 4",
"$ref": "#/$defs/colors"
},
"5": {
"title": "Color 5",
"$ref": "#/$defs/colors"
},
"6": {
"title": "Color 6",
"$ref": "#/$defs/colors"
},
"7": {
"title": "Color 7",
"$ref": "#/$defs/colors"
},
"8": {
"title": "Color 8",
"$ref": "#/$defs/colors"
},
"9": {
"title": "Color 9",
"$ref": "#/$defs/colors"
}
}
},
"width": {
"type": "integer",
"title": "Set the width of the logo (in characters). Required for iTerm image protocol",
"minimum": 1
},
"height": {
"type": "integer",
"title": "Set the height of the logo (in characters). Required for iTerm image protocol",
"minimum": 1
},
"padding": {
"type": "object",
"title": "Set the padding of the logo",
"properties": {
"top": {
"type": "integer",
"title": "Set the top padding of the logo",
"minimum": 0
},
"left": {
"type": "integer",
"title": "Set the left padding of the logo",
"minimum": 0
},
"right": {
"type": "integer",
"title": "Set the right padding of the logo",
"minimum": 0
}
}
},
"printRemaining": {
"type": "boolean",
"title": "Whether to print the remaining logo, if it has more lines than modules to display",
"default": false
},
"preserveAspectRadio": {
"type": "boolean",
"title": "Whether to preserve the aspect ratio of the logo. Supported by iTerm image protocol",
"default": false
},
"chafa": {
"type": "object",
"title": "Chafa configuration. See chafa document for details",
"properties": {
"fgOnly": {
"type": "boolean",
"title": "Produce character-cell output using foreground colors only",
"default": false
},
"symbols": {
"type": "string",
"title": "Specify character symbols to employ in final output"
},
"canvasMode": {
"type": "string",
"title": "Determine how colors are used in the output. This value maps the value of enum ChafaCanvasMode.",
"enum": [
"TRUECOLOR",
"INDEXED_256",
"INDEXED_240",
"INDEXED_16",
"FGBG_BGFG",
"FGBG",
"INDEXED_8",
"INDEXED_16_8"
]
},
"colorSpace": {
"type": "string",
"title": "Set color space used for quantization. This value maps the value of enum ChafaColorSpace.",
"enum": [
"RGB",
"DIN99D"
]
},
"ditherMode": {
"type": "string",
"title": "Set output dither mode (No effect with 24-bit color). This value maps the value of enum ChafaDitherMode.",
"enum": [
"NONE",
"ORDERED",
"DIFFUSION"
]
}
}
}
},
"additionalProperties": false
},
"general": {
"title": "Fastfetch general configurations",
"type": "object",
"properties": {
"allowSlowOperations": {
"type": "boolean",
"title": "Allow operations that can be very slow for more detailed output",
"default": false
},
"multithreading": {
"type": "boolean",
"title": "Use multiple threads to detect values",
"default": true
},
"stat": {
"type": "boolean",
"title": "Show time usage (in ms) for individual modules",
"default": false
},
"escapeBedrock": {
"type": "boolean",
"title": "On Bedrock Linux, whether to escape the bedrock jail",
"default": true
},
"pipe": {
"type": "boolean",
"title": "Whether to enable pipe mode (disable logo and all escape sequences)",
"default": false
},
"playerName": {
"type": "string",
"title": "The name of the player to use for module Media and Player. Linux only"
},
"osFile": {
"type": "string",
"title": "Set the path to the file containing OS information. Linux only"
}
},
"additionalProperties": false
},
"display": {
"title": "Configure how things to be displayed",
"type": "object",
"properties": {
"showErrors": {
"type": "boolean",
"title": "Print occurring errors to the console. False to ignore errored modules",
"default": false
},
"disableLinewrap": {
"type": "boolean",
"title": "Whether to disable line wrap during the run",
"default": true
},
"hideCursor": {
"type": "boolean",
"title": "Whether to hide the cursor during the run",
"default": true
},
"separator": {
"type": "string",
"title": "Set the separator between key and value",
"default": ": "
},
"color": {
"title": "Set the color of the keys and title",
"oneOf": [
{
"title": "Set the both color of the keys and title",
"$ref": "#/$defs/colors"
},
{
"type": "object",
"properties": {
"keys": {
"title": "Set the color of the keys",
"$ref": "#/$defs/colors"
},
"title": {
"title": "Set the color of the title",
"$ref": "#/$defs/colors"
}
}
}
]
},
"binaryPrefix": {
"type": "string",
"title": "Set the binary prefix to used when printing bytes",
"enum": [
"iec",
"si",
"jedec"
]
},
"percentType": {
"type": "number",
"title": "Set the percentage output type. 1 for percentage number, 2 for bar, 3 for both, 6 for bar only, 9 for colored number",
"minimum": 0,
"maximum": 9,
"default": 1
},
"noBuffer": {
"type": "boolean",
"title": "Whether to disable the stdout application buffer",
"default": false
}
},
"additionalProperties": false
},
"library": {
"title": "Set the path of a library to load",
"type": "object",
"properties": {
"pci": {
"type": "string",
"title": "GPU output (Linux and FreeBSD)"
},
"vulkan": {
"type": "string",
"title": "Vulkan module & fallback for GPU output"
},
"freetype": {
"type": "string",
"title": "Used for Termux font detection (Android)"
},
"wayland": {
"type": "string",
"title": "Better display performance and output in wayland sessions.\nSupports different refresh rates per monitor.\n(Linux)"
},
"xcbRandr": {
"type": "string",
"title": ""
},
"xcb": {
"type": "string",
"title": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
},
"xrandr": {
"type": "string",
"title": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
},
"x11": {
"type": "string",
"title": "X11 sessions for better display detection and faster WM detection.\nThe *randr ones provide multi monitor support The libxcb* ones usually have better performance.\n (Linux, FreeBSD)"
},
"gio": {
"type": "string",
"title": "Needed for values that are only stored GSettings (Linux, FreeBSD)"
},
"dconf": {
"type": "string",
"title": "Needed for values that are only stored in DConf + Fallback for GSettings (Linux, FreeBSD)"
},
"dbus": {
"type": "string",
"title": "Bluetooth, Player & Media detection (Linux, FreeBSD)"
},
"xfconf": {
"type": "string",
"title": "Needed for XFWM theme and XFCE Terminal font (Linux, FreeBSD)"
},
"sqlite3": {
"type": "string",
"title": "Needed for pkg & rpm package count (Linux, FreeBSD)"
},
"rpm": {
"type": "string",
"title": "Slower fallback for rpm package count. Needed on openSUSE & old CentOS / Redhat. (Linux)"
},
"imagemagick": {
"type": "string",
"title": "Images in terminal using sixel or kitty graphics protocol (Linux, FreeBSD, macOS)"
},
"z": {
"title": "Libz. Faster image output when using kitty graphics protocol (Linux, FreeBSD, macOS)",
"type": "string"
},
"chafa": {
"type": "string",
"title": "Image output as ascii art (Linux, FreeBSD, macOS)"
},
"egl": {
"type": "string",
"title": "Needed by the OpenGL module for gl context creation (Linux, FreeBSD)"
},
"glx": {
"type": "string",
"title": "Needed by the OpenGL module for gl context creation (Linux, FreeBSD)"
},
"osmesa": {
"type": "string",
"title": "Needed by the OpenGL module for gl context creation (Linux, FreeBSD)"
},
"opencl": {
"type": "string",
"title": "OpenCL module (Linux, FreeBSD, Windows)"
},
"pulse": {
"title": "Pulseaudio. Used for Sound detection (Linux, FreeBSD)",
"type": "string"
},
"nm": {
"title": "NetworkManager. Used for Wifi detection (Linux)",
"type": "string"
}
},
"additionalProperties": false
},
"modules": {
"title": "Fastfetch modules to run",
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"title": "Run module with default configurations",
"enum": [
"battery",
"bios",
"bluetooth",
"board",
"break",
"brightness",
"chassis",
"cpu",
"cpuusage",
"command",
"colors",
"cursor",
"datetime",
"display",
"disk",
"de",
"font",
"gamepad",
"gpu",
"host",
"icons",
"kernel",
"lm",
"locale",
"localip",
"media",
"memory",
"opencl",
"opengl",
"os",
"packages",
"player",
"poweradapter",
"processes",
"publicip",
"separator",
"shell",
"sound",
"swap",
"terminal",
"terminalfont",
"title",
"theme",
"uptime",
"users",
"vulkan",
"wallpaper",
"weather",
"wm",
"wifi",
"wmtheme"
]
},
{
"type": "object",
"title": "Run module with custom configurations",
"required": [
"type"
],
"properties": {
"type": {
"title": "Module type",
"type": "string"
}
},
"oneOf": [
{
"title": "Break",
"description": "Print a empty line",
"properties": {
"type": {
"const": "break"
}
},
"additionalProperties": false
},
{
"properties": {
"type": {
"enum": [
"bios",
"board",
"brightness",
"chassis",
"cpuusage",
"cursor",
"datetime",
"de",
"font",
"gamepad",
"host",
"icons",
"kernel",
"lm",
"locale",
"media",
"memory",
"opencl",
"os",
"packages",
"player",
"poweradapter",
"processes",
"shell",
"swap",
"terminal",
"terminalfont",
"theme",
"uptime",
"users",
"vulkan",
"wallpaper",
"wm",
"wifi",
"wmtheme"
]
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Battery",
"properties": {
"type": {
"const": "battery"
},
"dir": {
"title": "The directory where the battery folders are. Standard: `/sys/class/power_supply/`. Linux only",
"type": "string"
},
"temp": {
"title": "Detect and display Battery temperature if supported",
"type": "boolean",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Bluetooth",
"properties": {
"type": {
"const": "bluetooth"
},
"showDisconnected": {
"title": "Set if disconnected bluetooth devices should be printed",
"type": "boolean",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "CPU",
"properties": {
"type": {
"const": "cpu"
},
"temp": {
"title": "Detect and display CPU temperature if supported",
"type": "boolean",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Colors",
"properties": {
"type": {
"const": "colors"
},
"symbol": {
"title": "Set the symbol to use",
"type": "string",
"enum": [
"block",
"circle",
"diamond",
"triangle",
"square",
"star"
],
"default": "block"
},
"paddingLeft": {
"title": "Set the number of white spaces to print before the symbol",
"type": "integer",
"minimum": 0,
"default": 0
}
}
},
{
"title": "Command",
"properties": {
"type": {
"const": "command"
},
"shell": {
"title": "Set the shell program to execute the command text\nDefault: cmd for Windows, csh for FreeBSD, bash for others",
"type": "string"
},
"text": {
"title": "Set the command text to be executed",
"type": "string"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Custom",
"description": "Print a custom string, with or without key",
"properties": {
"type": {
"const": "custom"
},
"key": {
"title": "Leave empty not to print the key",
"type": "string"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"title": "Text to print",
"type": "string"
}
},
"required": [
"format"
],
"additionalProperties": false
},
{
"title": "Display",
"properties": {
"type": {
"const": "display"
},
"compactType": {
"enum": [
"none",
"original",
"scaled"
],
"title": "Set if all displays should be printed in one line",
"default": "none"
},
"preciseRefreshRate": {
"title": "Set if decimal refresh rates should not be rounded into integers when printing",
"type": "boolean",
"default": true
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Disk",
"properties": {
"type": {
"const": "disk"
},
"folders": {
"type": "string",
"title": "A colon (semicolon on Windows) separated list of folder paths for the disk output\nDefault: \"/:/home\" (\"C:\\\\;D:\\\\ ...\" on Windows)"
},
"showExternal": {
"type": "boolean",
"title": "Set if external volume should be printed",
"default": true
},
"showHidden": {
"type": "boolean",
"title": "Set if hidden volumes should be printed",
"default": false
},
"showSubvolumes": {
"type": "boolean",
"title": "Set if subvolumes should be printed",
"default": false
},
"showUnknown": {
"type": "boolean",
"title": "Set if unknown (unable to detect sizes) volumes should be printed",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "GPU",
"properties": {
"type": {
"const": "gpu"
},
"temp": {
"title": "Detect and display GPU temperature if supported",
"type": "boolean",
"default": false
},
"forceVulkan": {
"title": "Force using vulkan to detect GPUs, which support video memory usage detection with `--allow-slow-operations`",
"type": "boolean",
"default": false
},
"hideType": {
"title": "Specify the type of GPUs should not be printed",
"enum": [
"integrated",
"discrete",
"none"
],
"default": "none"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Local IP",
"properties": {
"type": {
"const": "localip"
},
"showIpv4": {
"title": "Show IPv4 addresses",
"type": "boolean",
"default": true
},
"showIpv6": {
"title": "Show IPv6 addresses",
"type": "boolean",
"default": false
},
"showMac": {
"title": "Show MAC addresses",
"type": "boolean",
"default": false
},
"showLoop": {
"title": "Show loop back addresses (127.0.0.1)",
"type": "boolean",
"default": false
},
"compact": {
"title": "Show all IPs in one line",
"type": "boolean",
"default": false
},
"namePrefix": {
"title": "Show IPs with given name prefix only",
"type": "string"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "OpenGL",
"properties": {
"type": {
"const": "opengl"
},
"library": {
"title": "Set the OpenGL context creation library to use. Linux only",
"enum": [
"auto",
"egl",
"glx",
"osmesa"
],
"default": "auto"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Public IP",
"properties": {
"type": {
"const": "publicip"
},
"url": {
"title": "The URL of public IP detection server to be used. Only HTTP protocol is supported",
"type": "string",
"format": "url",
"default": "http://ipinfo.io/ip"
},
"timeout": {
"title": "Time in milliseconds to wait for the public ip server to respond",
"type": "integer",
"minimum": 0,
"default": "disabled (0)"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Separator",
"properties": {
"type": {
"const": "separator"
},
"string": {
"title": "Set the string to be printed",
"type": "string",
"format": "url",
"default": "http://ipinfo.io/ip"
}
},
"additionalProperties": false
},
{
"title": "Sound",
"properties": {
"type": {
"const": "sound"
},
"soundType": {
"title": "Set what type of sound devices should be printed",
"type": "string",
"enum": [
"main",
"active",
"all"
],
"default": "main"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
},
{
"title": "Title",
"properties": {
"type": {
"const": "title"
},
"fqdn": {
"type": "boolean",
"title": "Set if the title should use fully qualified domain name",
"default": false
}
},
"additionalProperties": false
},
{
"title": "Weather",
"properties": {
"type": {
"const": "weather"
},
"timeout": {
"title": "Time in milliseconds to wait for the weather server to respond",
"type": "integer",
"minimum": 0,
"default": "disabled (0)"
},
"outputFormat": {
"title": "The output weather format to be used (must be URI encoded)",
"type": "string",
"default": "%t+-+%C+(%l)"
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"format": {
"$ref": "#/$defs/format"
}
},
"additionalProperties": false
}
]
}
]
}
}
},
"additionalProperties": false
}
-116
View File
@@ -1,116 +0,0 @@
# Logo options
## General
| Option | Default | Description |
|--------|---------|-------------|
| `--logo`, `-l` | `""` | The logo source, interpreted depending on type |
| `--logo-type` | `auto` | The logo type. See the following categories for possible values |
| `--<type>` | `""` | Short for `--logo-type <type> --logo <value>` |
| `--logo-padding` | `""` | Sets the padding left and right of the logo |
| `--logo-padding-left` | `0` | Sets the padding left of the logo |
| `--logo-padding-right` | `4` | Sets the padding right of the logo |
| `--logo-padding-top` | `0` | Sets the padding top of the logo |
All filesytem paths can be:
* Absolute
* Relative to the current working directory
* Relative to any of the directories listed by `fastfetch --list-data-paths` + `/logos`
For example, the file `~/.local/share/fastfetch/logos/shrek` can simply be referenced as `shrek`.
## Text
| Option | Default | Description |
|--------|---------|-------------|
| `--logo-color-[1-9]` | `""` | Overrides a color for logos that support it |
| `--logo-print-remaining` | `true` | Print the remaining logo, if it is higher than the keys |
* Color placeholders are in the form `$[1-9]`. To print a `$`, use `$$`.
* If a color placeholder value is not set, the placeholder is simply discarded.
## Image
| Option | Default | Description |
|--------|---------|-------------|
| `--logo-width` | `""` | Sets the width of the logo for logos that support it |
| `--logo-height` | `""` | Sets the height of the logo for logos that support it |
* If one of the height / width options is set, but the other not, the aspect ratio is preserved.
* If neither height nor width is set, the original size is used.
# Logo types
## auto
Trys to detect the logo type depending on the value of `--logo`, in the following order:
* If the value is empty / not set, an autodected builtin logo is displayed.
* If the value is the name of a builtin logo, it is displayed.
* If the value is the path to an image file, and the terminal emulator is known to support an image protocol, the image is displayed.
* If the value is the path to a text file, the content is displayed.
* The autodetected builtin logo is displayed.
## builtin
The value of `--logo` is interpreted as the name of a builtin logo.
* If the value is empty / not set, it is autodetected.
* Use `--list-logos` to get a list of all available logos.
* Use `--print-logos` to see all available logos.
* All builtin logos set default values for `--logo-color-[1-9]`.
* Use `none` to disable the logo, but keep key colors from the detected logo.
## file
The value of `--logo` is interpreted as the path to a file. The content of the file is displayed.
* If the file can't be read, the autodetected builtin logo is displayed.
## file-raw
The value of `--logo` is interpreted as the path to a file. The content of the file is displayed.
* No color placeholder replacement is done.
* If the file can't be read, the autodetected builtin logo is displayed.
## data
The value of `--logo` is interpreted as the logo and directly displayed.
* If the value is empty / not set, the autodetected builtin logo is displayed.
## data-raw
The value of `--logo` is interpreted as the logo and directly displayed.
* No color placeholder replacement is done.
* If the value is empty / not set, the autodetected builtin logo is displayed.
## sixel
The value of `--logo` is interpreted as the path to an image file. It is displayed using the sixel graphics protocol.
* `fastfetch` must be compiled with the `imagemagick6` or `imagemagick7` feature.
## kitty
The value of `--logo` is interpreted as the path to an image file. It is displayed using the kitty graphics protocol.
* If the file is a png file, and both `--logo-width` and `--logo-height` are specified, the image is directly send to the terminal emulator.
* Otherwise `fastfetch` must be compiled with the `imagemagick6` or `imagemagick7` feature.
## iterm
The value of `--logo` is interpreted as the path to an image file. It is displayed using the iTerm graphics protocol.
* Both `--logo-width` and `--logo-height` must be specified.
## chafa
The value of `--logo` is interpreted as the path to an image file. It is converted to an ascii logo using `libchafa`.
* `fastfetch` must be compiled with the `chafa` feature.
* `fastfetch` must be compiled with the `imagemagick6` or `imagemagick7` feature.
* Use `--chafa-fg-only` to set weather to render foreground only.
* Use `--chafa-symbols` to set the symbols.
* Use `--chafa-canvas-mode` to set the canvas mode.
* Use `--chafa-color-space` to set the color space.
* Use `--chafa-dither-mode` to set the dither mode.
* See the [chafa documentation](https://hpjansson.org/chafa/man/) for more information.
## raw
The value of `--logo` is interpreted as the path to a binary file. It is printed as-is.
* Both `--logo-width` and `--logo-height` must be specified.
* Use this to display a pre converted image file.
* If the file can't be read, the autodetected builtin logo is displayed.