mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-01 10:32:35 +01:00
@@ -2,4 +2,10 @@
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
const char* ffDetectTheme(FFstrbuf* result);
|
||||
typedef struct FFThemeResult
|
||||
{
|
||||
FFstrbuf theme1;
|
||||
FFstrbuf theme2;
|
||||
} FFThemeResult;
|
||||
|
||||
const char* ffDetectTheme(FFThemeResult* result);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "detection/gtk_qt/gtk_qt.h"
|
||||
#include "detection/displayserver/displayserver.h"
|
||||
|
||||
const char* ffDetectTheme(FFstrbuf* result)
|
||||
const char* ffDetectTheme(FFThemeResult* result)
|
||||
{
|
||||
const FFDisplayServerResult* wmde = ffConnectDisplayServer();
|
||||
|
||||
@@ -18,6 +18,8 @@ const char* ffDetectTheme(FFstrbuf* result)
|
||||
if(plasma->widgetStyle.length == 0 && plasma->colorScheme.length == 0 && gtk2->length == 0 && gtk3->length == 0 && gtk4->length == 0)
|
||||
return "No themes found";
|
||||
|
||||
ffParseGTK(&result->theme2, gtk2, gtk3, gtk4);
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY plasmaColorPretty = ffStrbufCreate();
|
||||
if(ffStrbufStartsWithIgnCase(&plasma->colorScheme, &plasma->widgetStyle))
|
||||
ffStrbufAppendNS(&plasmaColorPretty, plasma->colorScheme.length - plasma->widgetStyle.length, &plasma->colorScheme.chars[plasma->widgetStyle.length]);
|
||||
@@ -26,42 +28,32 @@ const char* ffDetectTheme(FFstrbuf* result)
|
||||
|
||||
ffStrbufTrim(&plasmaColorPretty, ' ');
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY gtkPretty = ffStrbufCreate();
|
||||
ffParseGTK(>kPretty, gtk2, gtk3, gtk4);
|
||||
|
||||
if(plasma->widgetStyle.length > 0)
|
||||
{
|
||||
ffStrbufAppend(result, &plasma->widgetStyle);
|
||||
ffStrbufAppend(&result->theme1, &plasma->widgetStyle);
|
||||
|
||||
if(plasma->colorScheme.length > 0)
|
||||
{
|
||||
ffStrbufAppendS(result, " (");
|
||||
ffStrbufAppendS(&result->theme1, " (");
|
||||
|
||||
if(plasmaColorPretty.length > 0)
|
||||
ffStrbufAppend(result, &plasmaColorPretty);
|
||||
ffStrbufAppend(&result->theme1, &plasmaColorPretty);
|
||||
else
|
||||
ffStrbufAppend(result, &plasma->colorScheme);
|
||||
ffStrbufAppend(&result->theme1, &plasma->colorScheme);
|
||||
|
||||
ffStrbufAppendC(result, ')');
|
||||
ffStrbufAppendC(&result->theme1, ')');
|
||||
}
|
||||
}
|
||||
else if(plasma->colorScheme.length > 0)
|
||||
{
|
||||
if(plasmaColorPretty.length > 0)
|
||||
ffStrbufAppend(result, &plasmaColorPretty);
|
||||
ffStrbufAppend(&result->theme1, &plasmaColorPretty);
|
||||
else
|
||||
ffStrbufAppend(result, &plasma->colorScheme);
|
||||
ffStrbufAppend(&result->theme1, &plasma->colorScheme);
|
||||
}
|
||||
|
||||
if(plasma->widgetStyle.length > 0 || plasma->colorScheme.length > 0)
|
||||
{
|
||||
ffStrbufAppendS(result, " [QT]");
|
||||
|
||||
if(gtkPretty.length > 0)
|
||||
ffStrbufAppendS(result, ", ");
|
||||
}
|
||||
|
||||
ffStrbufAppend(result, >kPretty);
|
||||
ffStrbufAppendS(&result->theme1, " [QT]");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "theme.h"
|
||||
|
||||
const char* ffDetectTheme(FF_MAYBE_UNUSED FFstrbuf* result)
|
||||
const char* ffDetectTheme(FF_MAYBE_UNUSED FFThemeResult* result)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user