Skip to content

Commit 1c49ae5

Browse files
committed
Fastfetch: try $exePath/presets with --load-config
1 parent 2e82f82 commit 1c49ae5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/fastfetch.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,19 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val
779779
return;
780780
}
781781

782+
{
783+
//Try exe path
784+
ffStrbufSet(&absolutePath, &instance.state.platform.exePath);
785+
ffStrbufSubstrBeforeLastC(&absolutePath, '/');
786+
ffStrbufAppendS(&absolutePath, "/presets/");
787+
ffStrbufAppendS(&absolutePath, value);
788+
789+
bool success = isJsonConfig ? parseJsoncFile(absolutePath.chars) : parseConfigFile(data, absolutePath.chars);
790+
791+
if(success)
792+
return;
793+
}
794+
782795
//File not found
783796

784797
fprintf(stderr, "Error: couldn't find config: %s\n", value);

0 commit comments

Comments
 (0)