diff options
Diffstat (limited to 'src/detection/icons/icons_linux.c')
| -rw-r--r-- | src/detection/icons/icons_linux.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/detection/icons/icons_linux.c b/src/detection/icons/icons_linux.c new file mode 100644 index 0000000..0ecaa07 --- /dev/null +++ b/src/detection/icons/icons_linux.c @@ -0,0 +1,30 @@ +#include "icons.h" +#include "common/parsing.h" +#include "detection/gtk_qt/gtk_qt.h" +#include "detection/displayserver/displayserver.h" + +const char* ffDetectIcons(FFIconsResult* result) { + const FFDisplayServerResult* wmde = ffConnectDisplayServer(); + + if (ffStrbufIgnCaseEqualS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY)) { + return "Icons aren't supported in TTY"; + } + + const FFstrbuf* plasma = &ffDetectQt()->icons; + const FFstrbuf* gtk2 = &ffDetectGTK2()->icons; + const FFstrbuf* gtk3 = &ffDetectGTK3()->icons; + const FFstrbuf* gtk4 = &ffDetectGTK4()->icons; + + if (plasma->length == 0 && gtk2->length == 0 && gtk3->length == 0 && gtk4->length == 0) { + return "No icons could be found"; + } + + ffParseGTK(&result->icons2, gtk2, gtk3, gtk4); + + if (plasma->length > 0) { + ffStrbufAppend(&result->icons1, plasma); + ffStrbufAppendS(&result->icons1, " [Qt]"); + } + + return NULL; +} |