diff --git a/src/ThemeManager/DesktopTheme.py b/src/ThemeManager/DesktopTheme.py index ecc8725..36ef3a3 100644 --- a/src/ThemeManager/DesktopTheme.py +++ b/src/ThemeManager/DesktopTheme.py @@ -93,6 +93,25 @@ def set_desktop_theme(self, state: Dict, nexttheme: list): } self.apply_theme_map(mapping) + elif de in ["budgie", "budgie:gnome"]: + mapping = { + "com.solus-project.gsettings-daemon.plugins.polkit": ("theme", nexttheme[4]), + "org.gnome.desktop.interface": [ + ("gtk-theme", nexttheme[4]), + ("icon-theme", nexttheme[7]), + ("cursor-theme", nexttheme[8]), + ("color-scheme", nexttheme[6]), + ], + "org.gnome.desktop.wm.preferences": ("theme", nexttheme[5]) + } + # Optional: Budgie-specific 'Desktop' theme (the panel look) + try: + self.set_gsetting("com.solus-project.budgie-panel", "theme", nexttheme[3]) + except Exception: + pass + + self.apply_theme_map(mapping) + elif de in ["gnome", "ubuntu:gnome", "unity"]: self.apply_gnome_theme(nexttheme) @@ -126,6 +145,7 @@ def set_desktop_theme(self, state: Dict, nexttheme: list): "Icon": nexttheme[7], "Cursor": nexttheme[8], "Plank": nexttheme[9], + "Color scheme": nexttheme[6], }) except Exception as e: @@ -173,6 +193,12 @@ def get_desktop_theme(self, state: Dict, systheme: str, colvariants: list) -> Di themes = {} schema_map = { + "budgie": { + "Applications": "org.gnome.desktop.interface gtk-theme", + "Decoration": "org.gnome.desktop.wm.preferences theme", + "Icon": "org.gnome.desktop.interface icon-theme", + "Cursor": "org.gnome.desktop.interface cursor-theme", + }, "x-cinnamon": { "Applications": "org.cinnamon.desktop.interface gtk-theme", "Decoration": "org.cinnamon.desktop.wm.preferences theme", @@ -211,7 +237,7 @@ def get_desktop_theme(self, state: Dict, systheme: str, colvariants: list) -> Di # Detect variant variant = "Default" for v in colvariants: - if v and v.lower() in themes.get("System", "").lower(): + if v and v.lower() in themes.get("Applications", "").lower(): variant = v break diff --git a/src/ThemeManager/gui.py b/src/ThemeManager/gui.py index 6d1b6dd..460b43a 100644 --- a/src/ThemeManager/gui.py +++ b/src/ThemeManager/gui.py @@ -285,6 +285,9 @@ def on_random_button(self, widget): self.state = self.manager.get_state_info() self.nexttheme = self.manager.prep_theme_variants(self.state, self.theme_styles) self.destop_manager.set_desktop_theme(self.state, self.nexttheme) + # Wait 1 sec before updating current theme in GUI + import time + time.sleep(1) self.currenttheme = self.destop_manager.get_desktop_theme(self.state, self.manager.systemthemename, self.manager.colvariants) self.current_status() @@ -338,7 +341,7 @@ def current_status(self): ''' Show current theme info in status bar. ''' - module_logger.debug(("%s", self.currenttheme)) + module_logger.debug(_("Current Themes: %s" % self.currenttheme)) status = "DE: %s, \tState: %s, \tVariant: %s, \tLast Updated: %s, \tThemes: %s" % (self.state['DE'], self.state['State'], self.currenttheme["Variant"], "", self.currenttheme["Themes"]) context_id = self.statusbar.get_context_id("status")