mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Fastfetch: enhances config file loading with support for config directory
Fixes #2080
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# 2.56.0
|
||||
|
||||
Features:
|
||||
* Enhances config file loading. `--config` and `-c` with relative path now also searches paths defined in `fastfetch --list-config-paths` (typically `~/.config/fastfetch/`)
|
||||
* This allows users to use `fastfetch -c my-config` without needing to specify the full path.
|
||||
* Adds NUMA node count detection (CPU)
|
||||
* Exposed via `{numa-nodes}` in custom format
|
||||
* Supported on Linux, FreeBSD and Windows
|
||||
|
||||
+15
-2
@@ -502,7 +502,20 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val
|
||||
|
||||
if (parseJsoncFile(absolutePath.chars, flag)) return;
|
||||
|
||||
//Try to load as a relative path
|
||||
//Try to load as a relative path with the config directory
|
||||
|
||||
FF_LIST_FOR_EACH(FFstrbuf, path, instance.state.platform.configDirs)
|
||||
{
|
||||
ffStrbufSet(&absolutePath, path);
|
||||
ffStrbufAppendS(&absolutePath, "fastfetch/");
|
||||
ffStrbufAppendS(&absolutePath, value);
|
||||
if (needExtension)
|
||||
ffStrbufAppendS(&absolutePath, ".jsonc");
|
||||
|
||||
if (parseJsoncFile(absolutePath.chars, flag)) return;
|
||||
}
|
||||
|
||||
//Try to load as a preset
|
||||
|
||||
FF_LIST_FOR_EACH(FFstrbuf, path, instance.state.platform.dataDirs)
|
||||
{
|
||||
@@ -515,7 +528,7 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val
|
||||
if (parseJsoncFile(absolutePath.chars, flag)) return;
|
||||
}
|
||||
|
||||
//Try to load as a relative path with the directory of fastfetch binary
|
||||
//Try to load as a relative path with the directory of fastfetch binary, for Windows support
|
||||
|
||||
if (instance.state.platform.exePath.length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user