mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-30 19:44:42 -07:00
Extracted installation methods, created a new class for theme installers
This commit is contained in:
31
scripts/install/local_theme_installer.py
Normal file
31
scripts/install/local_theme_installer.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import os.path
|
||||
|
||||
from scripts import config
|
||||
from scripts.install.theme_installer import ThemeInstaller
|
||||
from scripts.theme import Theme
|
||||
from scripts.utils import remove_files
|
||||
|
||||
|
||||
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
|
||||
|
||||
def _define_theme(self):
|
||||
theme_folder = os.path.join(config.raw_theme_folder, config.gnome_folder)
|
||||
self.theme = Theme("gnome-shell", self.colors, theme_folder,
|
||||
config.themes_folder, config.temp_folder,
|
||||
mode=self.args.mode, is_filled=self.args.filled)
|
||||
|
||||
def _install_theme(self, hue, theme_name, sat):
|
||||
self.theme.prepare()
|
||||
self.theme.install(hue, theme_name, sat)
|
||||
|
||||
def _apply_tweaks_to_theme(self):
|
||||
self._apply_tweaks(self.theme)
|
Reference in New Issue
Block a user