From 1c49ae53241ac8b600f1d3a6cdf92d9432d8ced4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 24 Aug 2023 14:29:35 +0800 Subject: [PATCH] Fastfetch: try `$exePath/presets` with `--load-config` --- src/fastfetch.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/fastfetch.c b/src/fastfetch.c index 9786c070a..118146d16 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -779,6 +779,19 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val return; } + { + //Try exe path + ffStrbufSet(&absolutePath, &instance.state.platform.exePath); + ffStrbufSubstrBeforeLastC(&absolutePath, '/'); + ffStrbufAppendS(&absolutePath, "/presets/"); + ffStrbufAppendS(&absolutePath, value); + + bool success = isJsonConfig ? parseJsoncFile(absolutePath.chars) : parseConfigFile(data, absolutePath.chars); + + if(success) + return; + } + //File not found fprintf(stderr, "Error: couldn't find config: %s\n", value);