Fixed GDM installation, reworked label_files.py, fixed theme removing
This commit is contained in:
@@ -20,9 +20,13 @@ class GlobalThemeInstaller(ThemeInstaller):
|
||||
gdm_temp, mode=self.args.mode, is_filled=self.args.filled)
|
||||
|
||||
def _install_theme(self, hue, theme_name, sat):
|
||||
self.theme.prepare()
|
||||
self.theme.install(hue, sat)
|
||||
|
||||
def _apply_tweaks_to_theme(self):
|
||||
for theme in self.theme.themes:
|
||||
self._apply_tweaks(theme.theme)
|
||||
self._apply_tweaks(theme.theme)
|
||||
|
||||
def _after_install(self):
|
||||
print("\nGDM theme installed successfully.")
|
||||
print("You need to restart gdm.service to apply changes.")
|
||||
print("Run \"systemctl restart gdm.service\" to restart GDM.")
|
||||
@@ -10,12 +10,8 @@ class LocalThemeInstaller(ThemeInstaller):
|
||||
theme: Theme
|
||||
|
||||
def remove(self):
|
||||
args = self.args
|
||||
colors = self.colors.colors
|
||||
if args.remove or args.reinstall:
|
||||
remove_files(args, colors)
|
||||
if not args.reinstall:
|
||||
return
|
||||
remove_files(self.args, colors)
|
||||
|
||||
def _define_theme(self):
|
||||
theme_folder = os.path.join(config.raw_theme_folder, config.gnome_folder)
|
||||
@@ -28,4 +24,7 @@ class LocalThemeInstaller(ThemeInstaller):
|
||||
self.theme.install(hue, theme_name, sat)
|
||||
|
||||
def _apply_tweaks_to_theme(self):
|
||||
self._apply_tweaks(self.theme)
|
||||
self._apply_tweaks(self.theme)
|
||||
|
||||
def _after_install(self):
|
||||
print("\nTheme installed successfully.")
|
||||
@@ -1,11 +1,13 @@
|
||||
import argparse
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from scripts.install.colors_definer import ColorsDefiner
|
||||
from scripts.theme import Theme
|
||||
from scripts.tweaks_manager import TweaksManager
|
||||
|
||||
|
||||
class ThemeInstaller:
|
||||
class ThemeInstaller(ABC):
|
||||
"""Base class for theme installers"""
|
||||
theme: Theme
|
||||
|
||||
def __init__(self, args: argparse.Namespace, colors: ColorsDefiner):
|
||||
@@ -14,24 +16,39 @@ class ThemeInstaller:
|
||||
self.stop_after_first_installed_color = False
|
||||
self._define_theme()
|
||||
|
||||
@abstractmethod
|
||||
def remove(self):
|
||||
"""Method for removing already installed themes"""
|
||||
pass
|
||||
|
||||
def install(self):
|
||||
self.theme.prepare()
|
||||
self._apply_tweaks_to_theme()
|
||||
self._apply_colors()
|
||||
self._after_install()
|
||||
|
||||
@abstractmethod
|
||||
def _define_theme(self):
|
||||
"""Here is the place to define the theme object"""
|
||||
pass
|
||||
|
||||
def _install_theme(self, hue, theme_name, sat):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def _apply_tweaks_to_theme(self):
|
||||
"""Should apply the tweaks for prepared theme"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def _install_theme(self, hue, theme_name, sat):
|
||||
"""Should say how to install the defined theme"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def _after_install(self):
|
||||
"""Method to be called after the theme is installed. Can be used for logging or other actions"""
|
||||
pass
|
||||
|
||||
def _apply_tweaks(self, theme):
|
||||
"""This method should be called in the _apply_tweaks_to_theme method"""
|
||||
tweaks_manager = TweaksManager()
|
||||
tweaks_manager.apply_tweaks(self.args, theme, self.colors)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user