More informations in default config file

This commit is contained in:
Linus Dierheimer
2021-10-23 14:59:11 +02:00
parent b3ef53ddc9
commit 1df591b46f
8 changed files with 121 additions and 29 deletions
+1
View File
@@ -45,6 +45,7 @@ function(fastfetch_load_text FILENAME OUTVAR)
set("${OUTVAR}" "${TEMP}" PARENT_SCOPE)
endfunction(fastfetch_load_text)
fastfetch_load_text(src/data/structure.txt DATATEXT_STRUCTURE)
fastfetch_load_text(src/data/config.txt DATATEXT_CONFIG)
fastfetch_load_text(src/data/modules.txt DATATEXT_MODULES)
fastfetch_load_text(src/data/help.txt DATATEXT_HELP)
+5 -5
View File
@@ -99,12 +99,12 @@ __fastfetch_completion()
"-v"
"--version"
"--list-logos"
"--list-modules"
"--list-presets"
"--list-features"
"--print-logos"
"--print-default-config"
"--print-default-structure"
"--print-available-modules"
"--print-available-presets"
"--list-supported-features"
"--print-config"
"--print-structure"
)
local FF_OPTIONS_HELP=(
+1
View File
@@ -0,0 +1 @@
--structure Title:Separator:OS:Host:Kernel:Uptime:Processes:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:LocalIP:Locale:Break:Colors
+92 -2
View File
@@ -3,6 +3,96 @@
# Direct arguments will overwrite the corresponding ones in this file.
# Whitespaces are trimmed at the beginning and the end.
# Empty lines or lines starting with # are ignored.
# There are more arguments possible than the ones listed here, take a look at fastfetch --help
# This file was shipped with $"FASTFETCH_PROJECT_VERSION$".
# Use fastfetch --print-default-config > ~/.config/fastfetch/config.conf to generate a new one with current default
# Use fastfetch --print-config > ~/.config/fastfetch/config.conf to generate the current default one
# Below some options are listed. Uncomment and modify them so they take affect.
# Note that there are a lot more options than listed here, take a look at "fastfetch --help".
# Notably all the --*-format and --*-key options are missing.
# Of course all of the can be made persistent here too.
# Config option:
# Load additional config files.
# Some are shipped with fastfetch, list them with "fastfetch --list-presets".
# Must be a path to a config file or the name of a shipped preset.
# The config file is completly loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones.
# Can be used multiple times to load multiple config files / presets.
#--load-config /path/to/config.txt
# Structure option:
# Sets the modules to use and their order.
# List available modules with "fastfetch --list-modules".
# Get the default structure with "fastfetch --print-structure".
# Must be a list of module names, separated by colons.
# Default is $"FASTFETCH_DATATEXT_STRUCTURE$".
#--structure $"FASTFETCH_DATATEXT_STRUCTURE$"
# Logo option:
# Sets the logo to use.
# List available logos with "fastfetch --list-logos".
# Print available logos with "fastfetch --print-logos".
# Must be the name of an available logo or a path to a text file containing a custom logo.
# Default is the current distribution.
#--logo arch
# Color option:
# Sets the color of the keys.
# Must be linux console color codes.
# Default is the primary color of the logo.
# Use "fastfetch --help color" to learn more and see examples.
#--color 35
# Spacing option:
# Sets the amount of whitespace between the logo and keys.
# Must be an positive integer.
# Default is 4.
#--spacing 4
# Separator option:
# Sets the string placed between a key and its value.
# Can be any string.
# Default is ": ".
#--separator ": "
# Offset option:
# Sets the amount of whitespace before the logo. Can be negative to cut the logo.
# Must be an integer.
# Default is 0.
#--offsetx 0
# Linewrap option:
# Sets if fastfetch should disable linewrap during the run.
# Must be true or false.
# Default is true.
#--disable-linewrap true
# Cursor option:
# Sets if fastfetch should hide the console cursor during the run.
# Must be true or false.
# Default is true.
#--hide-cursor true
# Remaing logo option:
# Sets if the remaining logo should be printed, if it is higher than the information printed.
# Must be true or false.
# Default is true.
#--print-remaining-logo true
# Multithreading option:
# Sets if fastfetch should use multiple threads to detect the values.
# Must be true or false.
# Default is true.
#--multithreading true
# Slow operations option:
# Sets if fastfetch is allowed to use known slow operations to detect more / better values.
# Must be true or false.
# Default is false.
#--allow-slow-operations false
# Color logo option:
# Sets if the logo should be colored.
# Must be true or false.
# Default is true.
#--color-logo true
+12 -12
View File
@@ -1,19 +1,19 @@
Usage: fastfetch <options>
Informative options:
-h, --help: shows this message and exits
-h <command>, --help <command>: shows help for a specific command and exits
-v --version: prints the version of fastfetch and exits
--list-logos: list available logos and exits
--print-logos: shows available logos and exits
--print-default-config: prints the default config and exits
--print-default-structure: prints the default stucture and exits
--print-available-modules: prints a list of available modules and exits
--print-available-presets: list presets fastfetch knows about. They can be loaded with --load-config. (+)
--list-supported-features: list the supported features fastfetch was compiled with. Mainly for development.
-h, --help: shows this message and exits
-h <command>, --help <command>: shows help for a specific command and exits
-v --version: prints the version of fastfetch and exits
--list-logos: list available logos and exits
--list-modules: lists available modules and exits
--list-presets: list presets fastfetch knows about and exits. They can be loaded with --load-config. (+)
--list-features: list the supported features fastfetch was compiled with and exits. Mainly for development.
--print-logos: show available logos and exits
--print-config: prints the default config and exits
--print-structure: prints the default stucture and exits
General options:
--structure <structure>: sets the structure of the fetch. Must be a colon separated list of keys. Use --print-available-modules to show th
--structure <structure>: sets the structure of the fetch. Must be a colon separated list of keys. Use "fastfetch --list-modules" to see the ones available.
--set <key=value>: hard set the value of a key
-c <color>, --color <color>: sets the color of the keys. Must be a linux console color code (+)
--spacing <width>: sets the distance between logo and text
@@ -30,7 +30,7 @@ General options:
--hide-cursor <?value>: Hide the cursor during the run
Logo options:
-l <name>, --logo <name>: sets the shown logo. Also changes the main color accordingly. This will also load file contents as logo if the given argument
-l <name>, --logo <name>: sets the shown logo. Also changes the main color accordingly. This will also load file contents as logo if the given argument is a valid path.
--color-logo <?value>: if set to false, the logo will be black / white
Format options: Provide the format string for custom output. Use fastfetch --help *-format for specific help.
+1
View File
@@ -0,0 +1 @@
Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:Locale:Break:Colors
+7 -9
View File
@@ -8,8 +8,6 @@
#include <fcntl.h>
#include <dirent.h>
#define FASTFETCH_DEFAULT_STRUCTURE "Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:Locale:Break:Colors"
// Things only needed by fastfetch
typedef struct FFdata
{
@@ -522,27 +520,27 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
ffPrintLogos(instance);
exit(0);
}
else if(strcasecmp(key, "--print-default-config") == 0)
else if(strcasecmp(key, "--print-config") == 0)
{
fputs(FASTFETCH_DATATEXT_CONFIG, stdout);
exit(0);
}
else if(strcasecmp(key, "--print-default-structure") == 0)
else if(strcasecmp(key, "--print-structure") == 0)
{
fputs(FASTFETCH_DEFAULT_STRUCTURE, stdout);
puts(FASTFETCH_DATATEXT_STRUCTURE);
exit(0);
}
else if(strcasecmp(key, "--print-available-modules") == 0)
else if(strcasecmp(key, "--list-modules") == 0)
{
fputs(FASTFETCH_DATATEXT_MODULES, stdout);
exit(0);
}
else if(strcasecmp(key, "--print-available-presets") == 0)
else if(strcasecmp(key, "--list-presets") == 0)
{
listAvailablePresets(instance);
exit(0);
}
else if(strcasecmp(key, "--list-supported-features") == 0)
else if(strcasecmp(key, "--list-features") == 0)
{
listSupportedFeatures();
exit(0);
@@ -904,7 +902,7 @@ static void run(FFinstance* instance, FFdata* data)
ffStartDetectionThreads(instance);
if(data->structure.length == 0)
ffStrbufSetS(&data->structure, FASTFETCH_DEFAULT_STRUCTURE);
ffStrbufSetS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE);
ffStart(instance);
+2 -1
View File
@@ -6,7 +6,8 @@
#ifndef FASTFETCH_BUILD_FLASHFETCH
#define FASTFETCH_DATATEXT_CONFIG "@DATATEXT_CONFIG@"
#define FASTFETCH_DATATEXT_STRUCTURE "@DATATEXT_STRUCTURE@"
#define FASTFETCH_DATATEXT_CONFIG "@DATATEXT_CONFIG@" //Requires FASTFETCH_PROJECT_VERSION and FASTFETCH_DATATEXT_STRUCTURE to be set
#define FASTFETCH_DATATEXT_MODULES "@DATATEXT_MODULES@"
#define FASTFETCH_DATATEXT_HELP "@DATATEXT_HELP@"
#define FASTFETCH_DATATEXT_HELP_COLOR "@DATATEXT_HELP_COLOR@"