Files
Marble-shell-theme/scripts/install/global_theme_installer.py
2025-04-10 18:29:19 +03:00

41 lines
1.5 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.

import os
from scripts import config
from scripts.gdm import GlobalTheme
from scripts.install.theme_installer import ThemeInstaller
from scripts.utils.logger.console import Console, Color, Format
from theme import SourceFolder
class GlobalThemeInstaller(ThemeInstaller):
theme: GlobalTheme
def remove(self):
gdm_rm_status = self.theme.remove()
if gdm_rm_status == 0:
print("GDM theme removed successfully.")
def _define_theme(self):
gdm_temp = os.path.join(config.temp_folder, config.gdm_folder)
source_folder = SourceFolder().gnome_shell
self.theme = GlobalTheme(self.colors, source_folder,
config.global_gnome_shell_theme, config.gnome_shell_gresource,
gdm_temp, mode=self.args.mode, is_filled=self.args.filled)
def _install_theme(self, hue, theme_name, sat):
self.theme.install(hue, sat)
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="🔄")