2021-04-03 23:10:14 +02:00
|
|
|
#include "fastfetch.h"
|
2022-07-25 12:24:23 +02:00
|
|
|
#include "common/properties.h"
|
2022-07-25 13:15:01 +02:00
|
|
|
#include "common/printing.h"
|
2022-07-25 13:59:19 +02:00
|
|
|
#include "common/parsing.h"
|
2022-07-25 14:20:07 +02:00
|
|
|
#include "common/settings.h"
|
2022-07-26 17:47:08 +02:00
|
|
|
#include "detection/gtk.h"
|
2022-09-06 15:42:37 +02:00
|
|
|
#include "detection/displayserver/displayserver.h"
|
2022-06-18 14:25:31 +02:00
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2021-04-26 17:27:12 +02:00
|
|
|
#include <string.h>
|
2021-04-03 23:10:14 +02:00
|
|
|
|
2021-04-15 18:59:26 +02:00
|
|
|
#define FF_WMTHEME_MODULE_NAME "WM Theme"
|
|
|
|
|
#define FF_WMTHEME_NUM_FORMAT_ARGS 1
|
|
|
|
|
|
2021-04-03 23:10:14 +02:00
|
|
|
static void printWMTheme(FFinstance* instance, const char* theme)
|
|
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
if(instance->config.wmTheme.outputFormat.length == 0)
|
2021-04-03 23:10:14 +02:00
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintLogoAndKey(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme.key);
|
2021-04-03 23:10:14 +02:00
|
|
|
puts(theme);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintFormat(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, FF_WMTHEME_NUM_FORMAT_ARGS, (FFformatarg[]){
|
2021-04-15 18:59:26 +02:00
|
|
|
{FF_FORMAT_ARG_TYPE_STRING, theme}
|
|
|
|
|
});
|
2021-04-03 23:10:14 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-09 22:09:01 +02:00
|
|
|
static void printWMThemeFromConfigFile(FFinstance* instance, const char* configFile, const char* themeRegex, const char* defaultValue)
|
2021-04-03 23:10:14 +02:00
|
|
|
{
|
2021-05-13 12:27:44 +02:00
|
|
|
FFstrbuf theme;
|
|
|
|
|
ffStrbufInit(&theme);
|
2021-05-09 21:41:17 +02:00
|
|
|
|
2021-05-13 12:27:44 +02:00
|
|
|
if(!ffParsePropFileConfig(instance, configFile, themeRegex, &theme))
|
2021-05-09 21:41:17 +02:00
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Config file %s doesn't exist", configFile);
|
2021-05-13 12:27:44 +02:00
|
|
|
ffStrbufDestroy(&theme);
|
2021-05-09 21:41:17 +02:00
|
|
|
return;
|
|
|
|
|
}
|
2021-04-03 23:10:14 +02:00
|
|
|
|
2021-05-13 12:27:44 +02:00
|
|
|
if(theme.length == 0)
|
2021-04-03 23:10:14 +02:00
|
|
|
{
|
2021-05-13 12:27:44 +02:00
|
|
|
ffStrbufDestroy(&theme);
|
|
|
|
|
|
2021-05-09 21:41:17 +02:00
|
|
|
if(defaultValue == NULL)
|
2021-05-07 11:02:09 +02:00
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't find WM theme in %s", configFile);
|
2021-05-07 11:02:09 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-09 21:41:17 +02:00
|
|
|
printWMTheme(instance, defaultValue);
|
|
|
|
|
return;
|
2021-04-03 23:10:14 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-26 16:47:47 +02:00
|
|
|
// Remove Plasma-generated prefixes
|
|
|
|
|
uint32_t idx = 0;
|
|
|
|
|
|
|
|
|
|
idx = ffStrbufFirstIndexS(&theme, "qml_");
|
2021-06-26 16:53:43 +02:00
|
|
|
if(idx != theme.length)
|
2021-06-26 16:47:47 +02:00
|
|
|
ffStrbufSubstrAfter(&theme, idx + 3);
|
|
|
|
|
|
|
|
|
|
idx = ffStrbufFirstIndexS(&theme, "svg__");
|
2021-06-26 16:53:43 +02:00
|
|
|
if(idx != theme.length)
|
2021-06-26 16:47:47 +02:00
|
|
|
ffStrbufSubstrAfter(&theme, idx + 4);
|
2021-06-26 08:14:11 +02:00
|
|
|
|
2021-05-13 12:27:44 +02:00
|
|
|
printWMTheme(instance, theme.chars);
|
|
|
|
|
ffStrbufDestroy(&theme);
|
2021-04-03 23:10:14 +02:00
|
|
|
}
|
|
|
|
|
|
2021-05-14 12:43:54 +02:00
|
|
|
static void printWMThemeFromSettings(FFinstance* instance, const char* dconfKey, const char* gsettingsSchemaName, const char* gsettingsPath, const char* gsettingsKey)
|
|
|
|
|
{
|
|
|
|
|
const char* theme = ffSettingsGet(instance, dconfKey, gsettingsSchemaName, gsettingsPath, gsettingsKey, FF_VARIANT_TYPE_STRING).strValue;
|
|
|
|
|
|
2022-01-07 18:00:38 +01:00
|
|
|
if(!ffStrSet(theme))
|
2021-05-14 12:43:54 +02:00
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't find WM theme in DConf or GSettings");
|
2021-05-14 12:43:54 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printWMTheme(instance, theme);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-23 19:56:49 +02:00
|
|
|
static void printGTKThemeAsWMTheme(FFinstance* instance)
|
|
|
|
|
{
|
2021-05-23 21:03:11 +02:00
|
|
|
const FFGTKResult* gtk = ffDetectGTK4(instance);
|
2021-05-23 19:56:49 +02:00
|
|
|
|
|
|
|
|
if(gtk->theme.length > 0)
|
|
|
|
|
{
|
|
|
|
|
printWMTheme(instance, gtk->theme.chars);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk = ffDetectGTK3(instance);
|
|
|
|
|
|
|
|
|
|
if(gtk->theme.length > 0)
|
|
|
|
|
{
|
|
|
|
|
printWMTheme(instance, gtk->theme.chars);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk = ffDetectGTK2(instance);
|
|
|
|
|
|
|
|
|
|
if(gtk->theme.length > 0)
|
|
|
|
|
{
|
|
|
|
|
printWMTheme(instance, gtk->theme.chars);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't detect GTK4/3/2 theme");
|
2021-05-23 19:56:49 +02:00
|
|
|
}
|
|
|
|
|
|
2021-05-23 21:50:01 +02:00
|
|
|
static void printMutter(FFinstance* instance)
|
|
|
|
|
{
|
|
|
|
|
const char* theme = ffSettingsGet(instance, "/org/gnome/shell/extensions/user-theme/name", "org.gnome.shell.extensions.user-theme", NULL, "name", FF_VARIANT_TYPE_STRING).strValue;
|
2022-01-07 18:00:38 +01:00
|
|
|
if(ffStrSet(theme))
|
2021-05-23 21:50:01 +02:00
|
|
|
{
|
|
|
|
|
printWMTheme(instance, theme);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printGTKThemeAsWMTheme(instance);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-08 11:20:17 +02:00
|
|
|
static void printMuffin(FFinstance* instance)
|
|
|
|
|
{
|
2021-05-11 20:06:17 +02:00
|
|
|
const char* name = ffSettingsGet(instance, "/org/cinnamon/theme/name", "org.cinnamon.theme", NULL, "name", FF_VARIANT_TYPE_STRING).strValue;
|
|
|
|
|
const char* theme = ffSettingsGet(instance, "/org/cinnamon/desktop/wm/preferences/theme", "org.cinnamon.desktop.wm.preferences", NULL, "theme", FF_VARIANT_TYPE_STRING).strValue;
|
2021-05-08 11:20:17 +02:00
|
|
|
|
|
|
|
|
if(name == NULL && theme == NULL)
|
|
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't find muffin theme in GSettings / DConf");
|
2021-05-08 11:20:17 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(name == NULL)
|
|
|
|
|
printWMTheme(instance, theme);
|
|
|
|
|
else if(theme == NULL)
|
|
|
|
|
printWMTheme(instance, name);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FFstrbuf buffer;
|
|
|
|
|
ffStrbufInit(&buffer);
|
|
|
|
|
ffStrbufAppendS(&buffer, name);
|
|
|
|
|
ffStrbufAppendS(&buffer, " (");
|
|
|
|
|
ffStrbufAppendS(&buffer, theme);
|
|
|
|
|
ffStrbufAppendC(&buffer, ')');
|
|
|
|
|
|
|
|
|
|
printWMTheme(instance, buffer.chars);
|
|
|
|
|
|
|
|
|
|
ffStrbufDestroy(&buffer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-11 20:06:17 +02:00
|
|
|
static void printXFWM4(FFinstance* instance)
|
|
|
|
|
{
|
|
|
|
|
const char* theme = ffSettingsGetXFConf(instance, "xfwm4", "/general/theme", FF_VARIANT_TYPE_STRING).strValue;
|
|
|
|
|
|
|
|
|
|
if(theme == NULL)
|
|
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't find xfwm4::/general/theme in XFConf");
|
2021-05-11 20:06:17 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printWMTheme(instance, theme);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-01 13:03:30 +02:00
|
|
|
static void printOpenbox(FFinstance* instance, const FFstrbuf* dePrettyName)
|
2021-04-25 21:18:56 +02:00
|
|
|
{
|
2021-04-26 21:56:21 +02:00
|
|
|
FFstrbuf absolutePath;
|
2021-04-25 21:18:56 +02:00
|
|
|
ffStrbufInitA(&absolutePath, 64);
|
|
|
|
|
ffStrbufAppendS(&absolutePath, instance->state.passwd->pw_dir);
|
2021-04-26 17:27:12 +02:00
|
|
|
ffStrbufAppendC(&absolutePath, '/');
|
|
|
|
|
|
2021-05-01 13:03:30 +02:00
|
|
|
if(ffStrbufIgnCaseCompS(dePrettyName, "LXQT") == 0)
|
2021-04-26 17:39:05 +02:00
|
|
|
ffStrbufAppendS(&absolutePath, ".config/openbox/lxqt-rc.xml");
|
2021-05-01 13:03:30 +02:00
|
|
|
else if(ffStrbufIgnCaseCompS(dePrettyName, "LXDE") == 0)
|
2021-04-26 17:39:05 +02:00
|
|
|
ffStrbufAppendS(&absolutePath, ".config/openbox/lxde-rc.xml");
|
2021-04-26 21:56:21 +02:00
|
|
|
else
|
2021-04-26 17:39:05 +02:00
|
|
|
ffStrbufAppendS(&absolutePath, ".config/openbox/rc.xml");
|
2021-04-26 21:56:21 +02:00
|
|
|
|
2021-04-25 21:18:56 +02:00
|
|
|
char* line = NULL;
|
|
|
|
|
size_t len = 0;
|
|
|
|
|
|
|
|
|
|
FILE* file = fopen(absolutePath.chars, "r");
|
2021-04-26 21:46:57 +02:00
|
|
|
if(file == NULL)
|
2021-04-25 21:18:56 +02:00
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't open \"%s\"", absolutePath.chars);
|
2021-04-26 21:46:57 +02:00
|
|
|
ffStrbufDestroy(&absolutePath);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-04-26 21:56:21 +02:00
|
|
|
|
|
|
|
|
FFstrbuf theme;
|
|
|
|
|
ffStrbufInitA(&theme, 256);
|
|
|
|
|
|
2021-04-26 21:46:57 +02:00
|
|
|
while(getline(&line, &len, file) != -1)
|
|
|
|
|
{
|
|
|
|
|
if(strstr(line, "<theme>") != 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-04-26 21:56:21 +02:00
|
|
|
|
2021-04-26 21:46:57 +02:00
|
|
|
while(getline(&line, &len, file) != -1)
|
|
|
|
|
{
|
|
|
|
|
if(strstr(line, "<name>") != 0)
|
2021-04-26 20:47:32 +02:00
|
|
|
{
|
2021-04-26 21:46:57 +02:00
|
|
|
ffStrbufAppendS(&theme, line);
|
|
|
|
|
ffStrbufRemoveStrings(&theme, 2, "<name>", "</name>");
|
|
|
|
|
ffStrbufTrimRight(&theme, '\n');
|
|
|
|
|
ffStrbufTrim(&theme, ' ');
|
|
|
|
|
break;
|
2021-04-26 20:47:32 +02:00
|
|
|
}
|
2021-04-26 21:56:21 +02:00
|
|
|
|
|
|
|
|
if(strstr(line, "</theme>") != 0) // sanity check
|
2021-04-26 21:46:57 +02:00
|
|
|
break;
|
2021-04-26 17:27:12 +02:00
|
|
|
}
|
2021-04-26 21:56:21 +02:00
|
|
|
|
2021-04-26 21:46:57 +02:00
|
|
|
if(line != NULL)
|
|
|
|
|
free(line);
|
|
|
|
|
|
|
|
|
|
fclose(file);
|
2021-04-26 20:47:32 +02:00
|
|
|
|
2021-04-26 17:39:05 +02:00
|
|
|
if(theme.length == 0)
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Couldn't find theme name in \"%s\"", absolutePath.chars);
|
2021-04-26 21:46:57 +02:00
|
|
|
else
|
|
|
|
|
printWMTheme(instance, theme.chars);
|
2021-04-25 21:18:56 +02:00
|
|
|
|
2021-04-26 17:27:12 +02:00
|
|
|
ffStrbufDestroy(&theme);
|
2021-04-26 20:47:32 +02:00
|
|
|
ffStrbufDestroy(&absolutePath);
|
2021-04-26 17:27:12 +02:00
|
|
|
}
|
2021-04-25 21:18:56 +02:00
|
|
|
|
2022-09-20 19:40:32 +08:00
|
|
|
#ifdef FF_HAVE_LIBPLIST
|
|
|
|
|
#include "common/library.h"
|
|
|
|
|
#include "common/io.h"
|
|
|
|
|
#include <plist/plist.h>
|
|
|
|
|
|
|
|
|
|
static const char* quartzCompositorParsePlist(FFinstance* instance, const FFstrbuf* content, FFstrbuf* theme) {
|
|
|
|
|
FF_LIBRARY_LOAD(libplist, &instance->config.libplist, "dlopen libplist failed", "libplist-2.0"FF_LIBRARY_EXTENSION, 2);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_is_binary);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_from_bin);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_from_xml);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_dict_get_item);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_get_string_ptr);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_get_uint_val);
|
|
|
|
|
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libplist, plist_free);
|
|
|
|
|
|
|
|
|
|
plist_t root_node = NULL;
|
|
|
|
|
if (ffplist_is_binary(content->chars, content->length))
|
|
|
|
|
ffplist_from_bin(content->chars, content->length, &root_node);
|
|
|
|
|
else
|
|
|
|
|
ffplist_from_xml(content->chars, content->length, &root_node);
|
|
|
|
|
|
|
|
|
|
if(root_node == NULL)
|
|
|
|
|
return "parsing Quartz Compositor preference file failed";
|
|
|
|
|
|
|
|
|
|
plist_t pWmThemeColor = ffplist_dict_get_item(root_node, "AppleAccentColor");
|
|
|
|
|
uint64_t wmThemeColor = 100;
|
|
|
|
|
if (pWmThemeColor != NULL)
|
|
|
|
|
ffplist_get_uint_val(pWmThemeColor, &wmThemeColor);
|
|
|
|
|
switch (wmThemeColor)
|
|
|
|
|
{
|
2022-09-21 15:16:47 +08:00
|
|
|
case (uint64_t)-1: ffStrbufAppendS(theme, "Graphite"); break;
|
2022-09-20 19:40:32 +08:00
|
|
|
case 0: ffStrbufAppendS(theme, "Red"); break;
|
|
|
|
|
case 1: ffStrbufAppendS(theme, "Orange"); break;
|
|
|
|
|
case 2: ffStrbufAppendS(theme, "Yellow"); break;
|
|
|
|
|
case 3: ffStrbufAppendS(theme, "Green"); break;
|
2022-09-21 15:16:47 +08:00
|
|
|
case 4: ffStrbufAppendS(theme, "Blue"); break;
|
2022-09-20 19:40:32 +08:00
|
|
|
case 5: ffStrbufAppendS(theme, "Purple"); break;
|
|
|
|
|
case 6: ffStrbufAppendS(theme, "Pink"); break;
|
2022-09-21 15:16:47 +08:00
|
|
|
default: ffStrbufAppendS(theme, "Multicolor"); break;
|
2022-09-20 19:40:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
plist_t pWmTheme = ffplist_dict_get_item(root_node, "AppleInterfaceStyle");
|
|
|
|
|
ffStrbufAppendF(theme, " (%s)", pWmTheme != NULL ? ffplist_get_string_ptr(pWmTheme, NULL) : "Light");
|
|
|
|
|
|
|
|
|
|
ffplist_free(root_node);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void printQuartzCompositor(FFinstance* instance) {
|
|
|
|
|
FFstrbuf fileName;
|
|
|
|
|
ffStrbufInitS(&fileName, instance->state.passwd->pw_dir);
|
|
|
|
|
ffStrbufAppendS(&fileName, "/Library/Preferences/.GlobalPreferences.plist");
|
|
|
|
|
|
|
|
|
|
FFstrbuf content;
|
|
|
|
|
ffStrbufInit(&content);
|
|
|
|
|
ffAppendFileBuffer(fileName.chars, &content);
|
|
|
|
|
ffStrbufDestroy(&fileName);
|
|
|
|
|
if(content.length == 0)
|
|
|
|
|
{
|
|
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "reading Quartz Compositor preference file failed");
|
|
|
|
|
ffStrbufDestroy(&content);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FFstrbuf theme;
|
|
|
|
|
ffStrbufInit(&theme);
|
|
|
|
|
const char* error = quartzCompositorParsePlist(instance, &content, &theme);
|
|
|
|
|
ffStrbufDestroy(&content);
|
|
|
|
|
|
|
|
|
|
if(error != NULL)
|
|
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "%s", error);
|
|
|
|
|
else
|
|
|
|
|
printWMTheme(instance, theme.chars);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
static void printQuartzCompositor(FFinstance* instance)
|
|
|
|
|
{
|
|
|
|
|
FF_UNUSED(instance);
|
|
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Fastfetch was compiled without libplist support");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-04-03 23:10:14 +02:00
|
|
|
void ffPrintWMTheme(FFinstance* instance)
|
|
|
|
|
{
|
2022-01-10 14:41:34 +01:00
|
|
|
#ifdef __ANDROID__
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "WM theme detection is not supported on Android");
|
2022-01-10 14:41:34 +01:00
|
|
|
return;
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-01-02 16:55:26 +01:00
|
|
|
const FFDisplayServerResult* result = ffConnectDisplayServer(instance);
|
2021-04-03 23:10:14 +02:00
|
|
|
|
2021-05-01 13:03:30 +02:00
|
|
|
if(result->wmPrettyName.length == 0)
|
2021-04-03 23:10:14 +02:00
|
|
|
{
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "WM Theme needs sucessfull WM detection");
|
2021-04-03 23:10:14 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-01 21:22:07 +02:00
|
|
|
if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "KWin") == 0 || ffStrbufIgnCaseCompS(&result->wmPrettyName, "KDE") == 0 || ffStrbufIgnCaseCompS(&result->wmPrettyName, "Plasma") == 0)
|
2021-05-15 14:58:43 +02:00
|
|
|
printWMThemeFromConfigFile(instance, "kwinrc", "theme =", "Breeze");
|
2021-05-09 21:41:17 +02:00
|
|
|
else if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "Xfwm4") == 0 || ffStrbufIgnCaseCompS(&result->wmPrettyName, "Xfwm") == 0)
|
2021-05-11 20:06:17 +02:00
|
|
|
printXFWM4(instance);
|
2021-05-23 19:56:49 +02:00
|
|
|
else if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "Mutter") == 0)
|
|
|
|
|
{
|
|
|
|
|
if(ffStrbufIgnCaseCompS(&result->dePrettyName, "Gnome") == 0)
|
|
|
|
|
printMutter(instance);
|
|
|
|
|
else
|
|
|
|
|
printGTKThemeAsWMTheme(instance);
|
|
|
|
|
}
|
2021-05-08 11:20:17 +02:00
|
|
|
else if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "Muffin") == 0)
|
|
|
|
|
printMuffin(instance);
|
2021-05-14 12:43:54 +02:00
|
|
|
else if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "Marco") == 0)
|
|
|
|
|
printWMThemeFromSettings(instance, "/org/mate/Marco/general/theme", "org.mate.Marco.general", NULL, "theme");
|
2021-05-01 13:03:30 +02:00
|
|
|
else if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "Openbox") == 0)
|
|
|
|
|
printOpenbox(instance, &result->dePrettyName);
|
2022-09-20 19:40:32 +08:00
|
|
|
else if(ffStrbufIgnCaseCompS(&result->wmPrettyName, "Quartz Compositor") == 0)
|
|
|
|
|
printQuartzCompositor(instance);
|
2021-04-03 23:10:14 +02:00
|
|
|
else
|
2022-06-17 18:15:36 +02:00
|
|
|
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmTheme, "Unknown WM: %s", result->wmPrettyName.chars);
|
2021-04-03 23:10:14 +02:00
|
|
|
}
|