From 09d683b706e4705fe91636c9eead43ea38a45841 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sun, 6 Apr 2025 17:21:32 +0800 Subject: [PATCH 1/3] WM (Linux): remove `v` from Hyprland version --- src/detection/wm/wm_linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/detection/wm/wm_linux.c b/src/detection/wm/wm_linux.c index 42c205dce..60ff5a3b8 100644 --- a/src/detection/wm/wm_linux.c +++ b/src/detection/wm/wm_linux.c @@ -38,6 +38,7 @@ static const char* getHyprland(FFstrbuf* result) { ffStrbufSubstrAfterFirstC(result, '"'); ffStrbufSubstrBeforeFirstC(result, '"'); + ffStrbufTrimLeft(result, 'v'); FF_DEBUG("Extracted version from version.h: %s", result->chars); return NULL; } From 03bc2dade9bde9868d7c9d1d38ad48998eb1341d Mon Sep 17 00:00:00 2001 From: Carter Li Date: Tue, 8 Apr 2025 09:11:08 +0800 Subject: [PATCH 2/3] Fastfetch: fix loading presets in `{exePath}/presets` Regression of v2.40.0 --- src/fastfetch.c | 15 ++++++++++++--- src/util/platform/FFPlatform_unix.c | 8 -------- src/util/platform/FFPlatform_windows.c | 8 -------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/fastfetch.c b/src/fastfetch.c index 19ff6a982..ccd4b37bf 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -483,13 +483,22 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val if (instance.state.platform.exePath.length) { - ffStrbufSet(&absolutePath, &instance.state.platform.exePath); - ffStrbufSubstrBeforeLastC(&absolutePath, '/'); - ffStrbufAppendS(&absolutePath, "/"); + uint32_t lastSlash = ffStrbufLastIndexC(&instance.state.platform.exePath, '/') + 1; + assert(lastSlash < instance.state.platform.exePath.length); + + // Try {exePath}/ + ffStrbufSetNS(&absolutePath, lastSlash, instance.state.platform.exePath.chars); ffStrbufAppendS(&absolutePath, value); if (needExtension) ffStrbufAppendS(&absolutePath, ".jsonc"); + if (parseJsoncFile(absolutePath.chars, strictJson)) return; + // Try {exePath}/presets/ + ffStrbufSubstrBefore(&absolutePath, lastSlash); + ffStrbufAppendS(&absolutePath, "presets/"); + ffStrbufAppendS(&absolutePath, value); + if (needExtension) + ffStrbufAppendS(&absolutePath, ".jsonc"); if (parseJsoncFile(absolutePath.chars, strictJson)) return; } diff --git a/src/util/platform/FFPlatform_unix.c b/src/util/platform/FFPlatform_unix.c index a6d5321d6..fbf59d85f 100644 --- a/src/util/platform/FFPlatform_unix.c +++ b/src/util/platform/FFPlatform_unix.c @@ -172,14 +172,6 @@ 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) diff --git a/src/util/platform/FFPlatform_windows.c b/src/util/platform/FFPlatform_windows.c index d95c9443f..71feae3f3 100644 --- a/src/util/platform/FFPlatform_windows.c +++ b/src/util/platform/FFPlatform_windows.c @@ -129,14 +129,6 @@ 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) From 563f9598be7f966007c640559c695ac47fe821f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 9 Apr 2025 14:24:27 +0800 Subject: [PATCH 3/3] Release: v2.40.4 --- CHANGELOG.md | 7 +++++++ CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 991e2408c..b8070ffa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 2.40.4 + +Bugfixes: +* Fix loading presets config on Windows (Windows, #1682) + * Regression of v2.40.0 +* Remove the prefix `v` of Hyprland version on Arch Linux (WM, Linux) + # 2.40.3 Bugfixes: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cc6895d4..9930b1a4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 2.40.3 + VERSION 2.40.4 LANGUAGES C DESCRIPTION "Fast neofetch-like system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"