mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Config: search for user config file in the order of configDirs
This is necessary to keep forward compatibility for Windows / macOS users. Since `$LOCALAPPPATH` and `~/Library/Preferences` are now the first element of `configDirs`, config files in `~/.config` won't be used in previous manner.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
Notable Changes:
|
||||
* fastfetch no longer creates a sample config file silently. Use `--gen-config` to generate one.
|
||||
* fastfetch now search for user config file in the order of `fastfetch --list-config-paths`
|
||||
|
||||
Features:
|
||||
* `--logo-padding-top` option (@CarterLi, #372)
|
||||
|
||||
+9
-5
@@ -1312,14 +1312,18 @@ static void parseConfigFileUser(FFinstance* instance, FFdata* data)
|
||||
if(!data->loadUserConfig)
|
||||
return;
|
||||
|
||||
FFstrbuf* filename = ffListGet(&instance->state.configDirs, 0);
|
||||
uint32_t filenameLength = filename->length;
|
||||
FF_LIST_FOR_EACH(FFstrbuf, filename, instance->state.configDirs)
|
||||
{
|
||||
uint32_t filenameLength = filename->length;
|
||||
|
||||
ffStrbufAppendS(filename, "fastfetch/config.conf");
|
||||
ffStrbufAppendS(filename, "fastfetch/config.conf");
|
||||
|
||||
parseConfigFile(instance, data, filename->chars);
|
||||
bool found = parseConfigFile(instance, data, filename->chars);
|
||||
|
||||
ffStrbufSubstrBefore(filename, filenameLength);
|
||||
ffStrbufSubstrBefore(filename, filenameLength);
|
||||
|
||||
if(found) break;
|
||||
}
|
||||
}
|
||||
|
||||
static void parseArguments(FFinstance* instance, FFdata* data, int argc, const char** argv)
|
||||
|
||||
Reference in New Issue
Block a user