From 6e1d656a601b2506b07270fc064a1b518fbee62b Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sat, 14 Jan 2023 16:58:09 +0100 Subject: [PATCH] Fix budgie detection #382 --- src/detection/displayserver/linux/wmde.c | 14 ++++++++++++++ src/detection/gtk.c | 9 ++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/detection/displayserver/linux/wmde.c b/src/detection/displayserver/linux/wmde.c index 3f564bfb6..4d9d79b6a 100644 --- a/src/detection/displayserver/linux/wmde.c +++ b/src/detection/displayserver/linux/wmde.c @@ -239,6 +239,13 @@ static void getLXQt(const FFinstance* instance, FFDisplayServerResult* result) ffStrbufDestroy(&wmProcessNameBuffer); } +static void getBudgie(const FFinstance* instance, FFDisplayServerResult* result) +{ + ffStrbufSetS(&result->dePrettyName, "Budgie"); + ffStrbufSetS(&result->deProcessName, "budgie-desktop"); + ffParsePropFileData(instance, "budgie/budgie-version.xml", "", &result->deVersion); +} + static void applyPrettyNameIfDE(const FFinstance* instance, FFDisplayServerResult* result, const char* name) { if(!ffStrSet(name)) @@ -282,6 +289,13 @@ static void applyPrettyNameIfDE(const FFinstance* instance, FFDisplayServerResul strcasecmp(name, "X-LXQT") == 0 || strcasecmp(name, "lxqt-session") == 0 ) getLXQt(instance, result); + + else if( + strcasecmp(name, "Budgie") == 0 || + strcasecmp(name, "X-Budgie") == 0 || + strcasecmp(name, "budgie-desktop") == 0 || + strcasecmp(name, "Budgie:GNOME") == 0 + ) getBudgie(instance, result); } static void getWMProtocolNameFromEnv(FFDisplayServerResult* result) diff --git a/src/detection/gtk.c b/src/detection/gtk.c index ad24c9c4e..71f8ac972 100644 --- a/src/detection/gtk.c +++ b/src/detection/gtk.c @@ -80,8 +80,11 @@ static void detectGTKFromSettings(const FFinstance* instance, FFGTKResult* resul cursorTheme = ffSettingsGet(instance, "/org/mate/peripherals-mouse/cursor-theme", "org.mate.peripherals-mouse", NULL, "cursor-theme", FF_VARIANT_TYPE_STRING).strValue; cursorSize = ffSettingsGet(instance, "/org/mate/peripherals-mouse/cursor-size", "org.mate.peripherals-mouse", NULL, "cursor-size", FF_VARIANT_TYPE_INT).intValue; } - else if(ffStrbufIgnCaseCompS(&wmde->dePrettyName, "Gnome") == 0 || ffStrbufIgnCaseCompS(&wmde->dePrettyName, "Unity") == 0 || ffStrbufIgnCaseCompS(&wmde->dePrettyName, "Budgie") == 0) - { + else if( + ffStrbufIgnCaseCompS(&wmde->dePrettyName, "Gnome") == 0 || + ffStrbufIgnCaseCompS(&wmde->dePrettyName, "Unity") == 0 || + fStrbufIgnCaseCompS(&wmde->dePrettyName, "Budgie") == 0 + ) { themeName = ffSettingsGet(instance, "/org/gnome/desktop/interface/gtk-theme", "org.gnome.desktop.interface", NULL, "gtk-theme", FF_VARIANT_TYPE_STRING).strValue; iconsName = ffSettingsGet(instance, "/org/gnome/desktop/interface/icon-theme", "org.gnome.desktop.interface", NULL, "icon-theme", FF_VARIANT_TYPE_STRING).strValue; fontName = ffSettingsGet(instance, "/org/gnome/desktop/interface/font-name", "org.gnome.desktop.interface", NULL, "font-name", FF_VARIANT_TYPE_STRING).strValue; @@ -145,7 +148,7 @@ static void detectGTKFromConfigDir(FFstrbuf* configDir, const char* version, FFG static void detectGTK(const FFinstance* instance, const char* version, FFGTKResult* result) { - //Mate, Cinnamon and Gnome use dconf to save theme config + //Mate, Cinnamon, Gnome, Unity, Budgie use dconf to save theme config //On other DEs, this will do nothing detectGTKFromSettings(instance, result); if(allPropertiesSet(result))