11from .system import test_gnome_availability
22from ..meta import Desktop
33from ._plugin import PluginDesktopDependent, PluginCommandline
4+ from pathlib import Path
5+ from os import scandir, path
6+
7+ theme_directories = ['/usr/share/icons', f'{Path.home()}/.icons']
48
59
610class Icons(PluginDesktopDependent):
@@ -10,6 +14,8 @@ def __init__(self, desktop: Desktop):
1014 super().__init__(_Mate())
1115 case Desktop.CINNAMON:
1216 super().__init__(_Cinnamon())
17+ case Desktop.BUDGIE:
18+ super().__init__(_Budgie())
1319 case _:
1420 super().__init__(None)
1521
@@ -34,3 +40,27 @@ def __init__(self):
3440 @property
3541 def available(self) -> bool:
3642 return test_gnome_availability(self.command)
43+
44+
45+ class _Budgie(PluginCommandline):
46+ def __init__(self):
47+ super().__init__(['gsettings', 'set', 'org.gnome.desktop.interface', 'icon-theme', '\"{theme}\"'])
48+ self.theme_light = 'Default'
49+ self.theme_dark = 'Default'
50+
51+ @property
52+ def available(self) -> bool:
53+ return test_gnome_availability(self.command)
54+
55+ @property
56+ def available_themes(self) -> dict:
57+ themes = []
58+
59+ for directory in theme_directories:
60+ if not path.isdir(directory):
61+ continue
62+
63+ with scandir(directory) as entries:
64+ themes.extend(d.name for d in entries if d.is_dir() and path.isfile(d.path + '/index.theme'))
65+
66+ return {t: t for t in themes}
0 commit comments