Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion src/ThemeManager/DesktopTheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion src/ThemeManager/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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")
Expand Down
Loading