Files
marble-shell-theme-packaging/scripts/install/global_theme_installer.py
Vladyslav Hroshev ca4e4d4cbe Refactor GDM module to correspond SOLID principles
- I don't know how I will support this hell ahh code;
- Added some methods to gnome_shell_theme_builder.py;
- Added "color" property "install" method from theme_base.py.
2025-04-12 23:30:34 +03:00

34 lines
1.3 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from scripts.install.theme_installer import ThemeInstaller
from scripts.utils.global_theme.gdm import GDMTheme
from scripts.utils.global_theme.gdm_builder import GdmBuilder
from scripts.utils.logger.console import Console, Color, Format
class GlobalThemeInstaller(ThemeInstaller):
theme: GDMTheme
def remove(self):
gdm_rm_status = self.theme.remove()
if gdm_rm_status == 0:
print("GDM theme removed successfully.")
def _define_theme(self):
gdm_builder = GdmBuilder(self.colors)
gdm_builder.with_mode(self.args.mode)
gdm_builder.with_filled(self.args.filled)
self.theme = gdm_builder.build()
def _apply_tweaks_to_theme(self):
for theme in self.theme.themes:
self._apply_tweaks(theme.theme)
def _after_install(self):
print()
Console.Line().update(
Console.format("GDM theme installed successfully.", color=Color.GREEN, format_type=Format.BOLD),
icon="🥳"
)
Console.Line().update("You need to restart GDM to apply changes.", icon=" ")
formatted_command = Console.format("systemctl restart gdm.service", color=Color.YELLOW, format_type=Format.BOLD)
Console.Line().update(f"Run {formatted_command} to restart GDM.", icon="🔄")