master ohmu/fastfetch-openbsd / src / detection / icons / icons_linux.c
ohmu  ·  2026-10-15
 1#include "icons.h"
 2#include "common/debug.h"
 3#include "common/parsing.h"
 4#include "detection/gtk_qt/gtk_qt.h"
 5#include "detection/displayserver/displayserver.h"
 6
 7const char* ffDetectIcons(FFIconsResult* result) {
 8    const FFDisplayServerResult* wmde = ffConnectDisplayServer();
 9
10    if (ffStrbufIgnCaseEqualS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY)) {
11        return "Icons aren't supported in TTY";
12    }
13
14    const FFstrbuf* plasma = &ffDetectQt()->icons;
15    const FFstrbuf* gtk2 = &ffDetectGTK2()->icons;
16    const FFstrbuf* gtk3 = &ffDetectGTK3()->icons;
17    const FFstrbuf* gtk4 = &ffDetectGTK4()->icons;
18
19    if (plasma->length == 0 && gtk2->length == 0 && gtk3->length == 0 && gtk4->length == 0) {
20        FF_DEBUG("No icons could be found");
21        return "No icons could be found";
22    }
23
24    ffParseGTK(&result->icons2, gtk2, gtk3, gtk4);
25
26    if (plasma->length > 0) {
27        ffStrbufAppend(&result->icons1, plasma);
28        ffStrbufAppendS(&result->icons1, " [Qt]");
29    }
30
31    return nullptr;
32}