fastfetch: load config from fastfetch binary path

Fix #1649
This commit is contained in:
Carter Li
2025-03-31 10:13:30 +08:00
committed by 李通洲
parent d11235bbe2
commit c64cbf57d8
3 changed files with 30 additions and 18 deletions
+8
View File
@@ -172,6 +172,14 @@ static void getDataDirs(FFPlatform* platform)
#endif
ffPlatformPathAddAbsolute(&platform->dataDirs, FASTFETCH_TARGET_DIR_USR "/local/share/");
ffPlatformPathAddAbsolute(&platform->dataDirs, FASTFETCH_TARGET_DIR_USR "/share/");
if (platform->exePath.length > 0)
{
// Add ${currentExePath}
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateCopy(&platform->exePath);
ffStrbufSubstrBeforeLastC(&path, '/');
ffPlatformPathAddAbsolute(&platform->dataDirs, path.chars);
}
}
static void getUserName(FFPlatform* platform, const struct passwd* pwd)
+8
View File
@@ -129,6 +129,14 @@ static void getDataDirs(FFPlatform* platform)
platformPathAddKnownFolder(&platform->dataDirs, &FOLDERID_RoamingAppData);
platformPathAddKnownFolder(&platform->dataDirs, &FOLDERID_LocalAppData);
ffPlatformPathAddHome(&platform->dataDirs, platform, "");
if (platform->exePath.length > 0)
{
// Add ${currentExePath}
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateCopy(&platform->exePath);
ffStrbufSubstrBeforeLastC(&path, '/');
ffPlatformPathAddAbsolute(&platform->dataDirs, path.chars);
}
}
static void getUserName(FFPlatform* platform)