From c29960abf24ef6bddac6e6e71963b03dd74824dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 2 Nov 2023 09:32:58 +0800 Subject: [PATCH 1/5] Presets: fix regression #606 --- presets/examples/11.jsonc | 4 +++- presets/examples/8.jsonc | 10 +++++++--- presets/examples/9.jsonc | 4 +++- src/data/config_user.jsonc | 4 +++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/presets/examples/11.jsonc b/presets/examples/11.jsonc index 13215add1..018cfd882 100644 --- a/presets/examples/11.jsonc +++ b/presets/examples/11.jsonc @@ -4,7 +4,9 @@ "type": "small" }, "display": { - "percentType": 9, + "percent": { + "type": 9 + }, "separator": "\u001b[31m-> " }, "modules": [ diff --git a/presets/examples/8.jsonc b/presets/examples/8.jsonc index 7fe01dd7f..3aea80971 100644 --- a/presets/examples/8.jsonc +++ b/presets/examples/8.jsonc @@ -8,9 +8,13 @@ "color": { "keys": "magenta" }, - "sizeNdigits": 0, - "sizeMaxPrefix": "MB", - "percentType": 9 + "size": { + "ndigits": 0, + "maxPrefix": "MB" + }, + "percent": { + "type": 9 + } }, "modules": [ { diff --git a/presets/examples/9.jsonc b/presets/examples/9.jsonc index 1dd6f7307..abdc69bd7 100644 --- a/presets/examples/9.jsonc +++ b/presets/examples/9.jsonc @@ -4,12 +4,14 @@ "type": "small" }, "display": { - "percentType": 6, "keyWidth": 11, "bar": { "charElapsed": "=", "charTotal": "-", "width": 13 + }, + "percent": { + "type": 9 } }, "modules": [ diff --git a/src/data/config_user.jsonc b/src/data/config_user.jsonc index 2e3bbb36f..07148cdac 100644 --- a/src/data/config_user.jsonc +++ b/src/data/config_user.jsonc @@ -9,7 +9,9 @@ } }, "display": { - "percentType": 9 // colored percent number + "percent": { + "type": 9 + } // colored percent number }, "modules": [ "title", From 0ffbb8c364a60735ee73b6892b5b09fade8b5322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 2 Nov 2023 14:03:41 +0800 Subject: [PATCH 2/5] Doc: update help messages --- doc/json_schema.json | 2 +- src/data/config_system.txt | 2 +- src/data/help.txt | 116 +++++++++++++++++++------------------ src/data/help_color.txt | 4 +- src/data/help_config.txt | 2 +- 5 files changed, 64 insertions(+), 62 deletions(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index 4dec417bd..558d442eb 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -452,7 +452,7 @@ }, "wayland": { "type": "string", - "description": "Better display performance and output in wayland sessions.\nSupports different refresh rates per monitor.\n(Linux)" + "description": "Better display performance and output in wayland sessions.\nSupports different refresh rates per monitor.\n(Linux, FreeBSD)" }, "xcbRandr": { "type": "string", diff --git a/src/data/config_system.txt b/src/data/config_system.txt index d4bb69cad..46f58c043 100644 --- a/src/data/config_system.txt +++ b/src/data/config_system.txt @@ -2,7 +2,7 @@ # This file sets the default config for all users of the system. # For more information about how configuration files work, -# see ~/.config/fastfetch/config.conf, generated during first run. +# see ~/.config/fastfetch/config.conf. # All options that can be put there (or passed as argument) can be put here too. # Use fastfetch --print-config-system > /etc/fastfetch/config.conf diff --git a/src/data/help.txt b/src/data/help.txt index ef5b98569..c04e58a1d 100644 --- a/src/data/help.txt +++ b/src/data/help.txt @@ -1,9 +1,11 @@ -Usage: fastfetch +Fastfetch is a neofetch-like tool for fetching system information and displaying them in a pretty way + +Usage: fastfetch Informative options: - -h,--help: Show this message - -h,--help : Show help for a specific command - -v,--version: Show the version of fastfetch + -h, --help: Show this message + -h, --help : Show help for a specific command + -v, --version: Show the version of fastfetch --list-config-paths: List search paths of config files --list-data-paths: List search paths of presets and logos --list-logos: List available logos @@ -16,21 +18,20 @@ Informative options: --print-structure: Print the default structure Config options: - --load-config,--config,-c : Load a config file or preset (+) - --gen-config : Generate a sample config file in the default path. Param `type` can be `jsonc` or deprecated `conf` - --gen-config-force : Generate a sample config file in the default path. Overwrite the existing one - --migrate-config : Migrate old flag based config file to new JSONC format. Optional param `path` is the file path that new file should be write to + -c, --load-config : Load a config file or preset (+) + --gen-config : Generate a sample config file in the default path. Param `type` can be `jsonc` or deprecated `conf` + --gen-config-force : Generate a sample config file in the default path. Overwrite the existing one + --migrate-config : Migrate old flag based config file to new JSONC format. Optional param `path` is the file path that new file should be write to General options: - --multithreading,--thread : Use multiple threads to detect values - --allow-slow-operations : Allow operations that are usually very slow for more detailed output - --escape-bedrock : On Bedrock Linux, whether to escape the bedrock jail - --wmi-timeout : Set the timeout (ms) for WMI queries. Windows only. Default is 5000 - --processing-timeout : Set the timeout (ms) when waiting for child processes. Default is 1000 - --ds-force-drm : Set if only DRM should be used to detect displays. Default is false. Linux only + --thread : Use separate threads to send HTTP requests + --escape-bedrock : On Bedrock Linux, whether to escape the bedrock jail + --wmi-timeout : Set the timeout (ms) for WMI queries. Windows only. Default is 5000 + --processing-timeout : Set the timeout (ms) when waiting for child processes. Default is 1000 + --ds-force-drm : Set if only DRM should be used to detect displays. Default is false. Linux only Logo options: - -l,--logo : Set the logo; if default, the name of a builtin logo or a path to a file + -l, --logo : Set the logo; if default, the name of a builtin logo or a path to a file --logo-type : Set the type of the logo given; must be auto, builtin, file, file-raw, data, data-raw, sixel, kitty, iterm or chafa --logo-width : Set the width of the logo (in characters), if it is an image. Required for iTerm image protocol --logo-height : Set the height of the logo (in characters), if it is an image. Required for iTerm image protocol @@ -58,7 +59,7 @@ Logo options: --chafa-dither-mode : Set output dither mode (No effect with 24-bit color). This value maps the int value of enum ChafaDitherMode. See chafa document for detail Display options: - -s,--structure : Set the structure of the fetch. Must be a colon separated list of keys. Use "fastfetch --list-modules" to see the ones available. + -s,--structure : Set the structure of the fetch. Must be a colon separated list of keys. Use `fastfetch --list-modules` to see the ones available. --stat : Show time usage (in ms) for individual modules --pipe : Disable logo and all escape sequences --color-keys : Set the color of the keys @@ -86,8 +87,8 @@ Display options: General module options: ---format : Set the format string to use for each specific module. - To see how a format string works, use fastfetch --help format. - To see help about a specific format string, use fastfetch --help -format. + To see how a format string works, use `fastfetch --help format`. + To see help about a specific format string, use `fastfetch --help -format`. ---key : Set the key to use for each specific module. For modules which print multiple lines, the string is parsed as a format string with the index as first character. @@ -96,29 +97,30 @@ General module options: ---key-width : Override the global `--key-width` option for each specific module. Library options: Set the path of a library to load - --lib-PCI - --lib-vulkan - --lib-wayland - --lib-xcb-randr - --lib-xcb - --lib-Xrandr - --lib-X11 - --lib-gio - --lib-DConf - --lib-DBus - --lib-XFConf - --lib-sqlite3 - --lib-rpm - --lib-imagemagick - --lib-z - --lib-chafa - --lib-egl - --lib-glx - --lib-osmesa - --lib-opencl - --lib-pulse - --lib-freetype - --lib-ddcutil + --lib-PCI : GPU output + --lib-vulkan : Vulkan module & fallback for GPU output + --lib-wayland : Better display performance and output in wayland sessions + --lib-xcb-randr : X11 sessions for better display detection and faster WM detection + --lib-xcb : X11 sessions for better display detection and faster WM detection + --lib-Xrandr : X11 sessions for better display detection and faster WM detection + --lib-X11 : X11 sessions for better display detection and faster WM detection + --lib-gio : Needed for values that are only stored GSettings + --lib-DConf : Needed for values that are only stored in DConf + Fallback for GSettings + --lib-DBus : Bluetooth, Player & Media detection + --lib-XFConf : Needed for XFWM theme and XFCE Terminal font + --lib-sqlite3 : Needed for pkg & rpm package count + --lib-rpm : Slower fallback for rpm package count + --lib-imagemagick : Images in terminal using sixel or kitty graphics protocol + --lib-z : Libz. Faster image output when using kitty graphics protocol + --lib-chafa : Image output as ascii art + --lib-egl : Needed by the OpenGL module for gl context creation + --lib-glx : Needed by the OpenGL module for gl context creation + --lib-osmesa : Needed by the OpenGL module for gl context creation + --lib-opencl : OpenCL module + --lib-pulse : Pulseaudio. Used for Sound detection + --lib-nm: NetworkManager. Used for Wifi detection + --lib-freetype : Used for Termux font detection + --lib-ddcutil : Used for brightness detection of external displays Module specific options: --title-fqdn : Set if the title should use fully qualified domain name. Default is false @@ -137,13 +139,13 @@ Module specific options: --disk-show-unknown : Set if unknown (unable to detect sizes) volumes should be printed. Default is false --disk-use-available : Use f_bavail (lpFreeBytesAvailableToCaller for Windows) instead of f_bfree to calculate used bytes. Default is false --diskio-name-prefix : Show disks with given name prefix only. Default is empty - --bluetooth-show-disconnected: : Set if disconnected bluetooth devices should be printed. Default is false - --packages-winget: : Set if winget package count should be detected. Default is false - --display-compact-type: : Set if all displays should be printed in one line. Default is none - --display-detect-name: : Set if display name should be detected and printed (if supported). Default is false - --display-precise-refresh-rate: :Set if decimal refresh rates should not be rounded into integers when printing. Default is true - --brightness-ddcci-sleep: Set the sleep times (in ms) when sending DDC/CI requests. See for detail. Default is 10 - --sound-type: : Set what type of sound devices should be printed. Should be either main, active or all. Default is main + --bluetooth-show-disconnected : Set if disconnected bluetooth devices should be printed. Default is false + --packages-winget : Set if winget package count should be detected. Default is false + --display-compact-type : Set if all displays should be printed in one line. Default is none + --display-detect-name : Set if display name should be detected and printed (if supported). Default is false + --display-precise-refresh-rate : Set if decimal refresh rates should not be rounded into integers when printing. Default is true + --brightness-ddcci-sleep : Set the sleep times (in ms) when sending DDC/CI requests. See for detail. Default is 10 + --sound-type : Set what type of sound devices should be printed. Should be either main, active or all. Default is main --battery-dir : The directory where the battery folders are. Standard: `/sys/class/power_supply/`. Linux only --battery-use-setup-api : Set if `SetupAPI` should be used on Windows to detect battery info, which supports multi batteries, but slower. Windows only --cpu-temp : Detect and display CPU temperature if supported. Default is false @@ -164,14 +166,14 @@ Module specific options: --localip-compact : Show all IPs in one line. Default is false --netio-name-prefix : Show interfaces with given name prefix only. Default is empty --netio-default-route-only : Show the interfac that is used for default routing only. Default is true - --publicip-timeout: Time in milliseconds to wait for the public ip server to respond. Default is disabled (0) - --publicip-url: The URL of public IP detection server to be used. - --weather-location: Set the location to be used. It must be URI encoded (eg a whitespace must be encoded as `+`). - --weather-timeout: Time in milliseconds to wait for the weather server to respond. Default is disabled (0) - --weather-output-format: The output weather format to be used. It must be URI encoded. - --wm-detect-plugin: Set if window manager plugin should be detected on supported platforms. Default is false - --player-name: The name of the player to use for module Media and Player. Linux only - --opengl-library : Set the OpenGL context creation library to use. Must be auto, egl, glx or osmesa. Default is auto + --publicip-timeout : Time in milliseconds to wait for the public ip server to respond. Default is disabled (0) + --publicip-url : The URL of public IP detection server to be used. + --weather-location : Set the location to be used. It must be URI encoded (eg a whitespace must be encoded as `+`). + --weather-timeout : Time in milliseconds to wait for the weather server to respond. Default is disabled (0) + --weather-output-format : The output weather format to be used. It must be URI encoded. + --wm-detect-plugin : Set if window manager plugin should be detected on supported platforms. Default is false + --player-name : The name of the player to use for module Media and Player. Linux only + --opengl-library : Set the OpenGL context creation library to use. Must be auto, egl, glx or osmesa. Default is auto --command-shell : Set the shell program to execute the command text. Default is cmd for Windows, /bin/sh for *nix --command-key : Set the module key to display --command-text : Set the command text to be executed @@ -181,4 +183,4 @@ Module specific options: Parsing is not case sensitive. E.g. "--lib-PCI" is equal to "--Lib-Pci" If a value starts with a ?, it is optional. "true" will be used if not set. A (+) at the end indicates that more help can be printed with --help