From c8debccd16d8a1a21452c761f827d842367a0d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 2 Jun 2025 10:19:36 +0800 Subject: [PATCH] DE (FreeBSD): support KDE version detection --- src/detection/de/de_linux.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/detection/de/de_linux.c b/src/detection/de/de_linux.c index a1bb98480..7237c53c0 100644 --- a/src/detection/de/de_linux.c +++ b/src/detection/de/de_linux.c @@ -10,18 +10,22 @@ #include "util/stringUtils.h" #include +#ifdef __FreeBSD__ + #include +#endif static void getKDE(FFstrbuf* result, FFDEOptions* options) { - ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) { - {"X-KDE-PluginInfo-Version =", result} - }); +#ifdef __FreeBSD__ + ffParsePropFile(_PATH_LOCALBASE "/share/wayland-sessions/plasma.desktop", "X-KDE-PluginInfo-Version =", result); if(result->length == 0) - { - ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) { - {"X-KDE-PluginInfo-Version =", result} - }); - } + ffParsePropFile(_PATH_LOCALBASE "/share/xsessions/plasmax11.desktop", "X-KDE-PluginInfo-Version =", result); +#else + ffParsePropFile(FASTFETCH_TARGET_DIR_USR "/share/wayland-sessions/plasma.desktop", "X-KDE-PluginInfo-Version =", result); + if(result->length == 0) + ffParsePropFile(FASTFETCH_TARGET_DIR_USR "/share/xsessions/plasmax11.desktop", "X-KDE-PluginInfo-Version =", result); +#endif + if(result->length == 0) ffParsePropFileData("xsessions/plasma.desktop", "X-KDE-PluginInfo-Version =", result); if(result->length == 0)