Skip to content

Commit c8debcc

Browse files
committed
DE (FreeBSD): support KDE version detection
1 parent 2853bd1 commit c8debcc

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/detection/de/de_linux.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@
1010
#include "util/stringUtils.h"
1111

1212
#include <ctype.h>
13+
#ifdef __FreeBSD__
14+
#include <paths.h>
15+
#endif
1316

1417
static void getKDE(FFstrbuf* result, FFDEOptions* options)
1518
{
16-
ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) {
17-
{"X-KDE-PluginInfo-Version =", result}
18-
});
19+
#ifdef __FreeBSD__
20+
ffParsePropFile(_PATH_LOCALBASE "/share/wayland-sessions/plasma.desktop", "X-KDE-PluginInfo-Version =", result);
1921
if(result->length == 0)
20-
{
21-
ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) {
22-
{"X-KDE-PluginInfo-Version =", result}
23-
});
24-
}
22+
ffParsePropFile(_PATH_LOCALBASE "/share/xsessions/plasmax11.desktop", "X-KDE-PluginInfo-Version =", result);
23+
#else
24+
ffParsePropFile(FASTFETCH_TARGET_DIR_USR "/share/wayland-sessions/plasma.desktop", "X-KDE-PluginInfo-Version =", result);
25+
if(result->length == 0)
26+
ffParsePropFile(FASTFETCH_TARGET_DIR_USR "/share/xsessions/plasmax11.desktop", "X-KDE-PluginInfo-Version =", result);
27+
#endif
28+
2529
if(result->length == 0)
2630
ffParsePropFileData("xsessions/plasma.desktop", "X-KDE-PluginInfo-Version =", result);
2731
if(result->length == 0)

0 commit comments

Comments
 (0)