From 75cbf0887944b7422c855844394fb2133844d510 Mon Sep 17 00:00:00 2001 From: Vladyslav Hroshev Date: Tue, 1 Apr 2025 21:20:28 +0300 Subject: [PATCH] Fixed opaque tweak, decreased sleep in apply_gnome_theme --- scripts/utils/gnome.py | 2 +- tweaks/opaque/tweak.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/utils/gnome.py b/scripts/utils/gnome.py index 1262503..9448766 100644 --- a/scripts/utils/gnome.py +++ b/scripts/utils/gnome.py @@ -29,7 +29,7 @@ def apply_gnome_theme(theme=None) -> bool: formatted_theme = Console.format(theme, color=Color.get(color, Color.GRAY), format_type=Format.BOLD) line.update(f"Applying {formatted_theme} theme...") - time.sleep(0.1) # applying the theme may freeze, so we need to wait a bit + time.sleep(0.025) # applying the theme may freeze, so we need to wait a bit apply_user_theme(theme) line.success(f"Theme {formatted_theme} applied.") except Exception: diff --git a/tweaks/opaque/tweak.py b/tweaks/opaque/tweak.py index d47af50..232c2ac 100755 --- a/tweaks/opaque/tweak.py +++ b/tweaks/opaque/tweak.py @@ -1,9 +1,12 @@ +from scripts.install.colors_definer import ColorsDefiner + + def define_arguments(parser): color_args = parser.add_argument_group('Color tweaks') color_args.add_argument('-O', '--opaque', action='store_true', help='make the background in menus/popovers opaque') -def apply_tweak(args, theme, colors): +def apply_tweak(args, theme, colors: ColorsDefiner): if args.opaque: - colors["elements"]["BACKGROUND-COLOR"]["light"]["a"] = 1 - colors["elements"]["BACKGROUND-COLOR"]["dark"]["a"] = 1 + colors.replacers["BACKGROUND-COLOR"]["light"]["a"] = 1 + colors.replacers["BACKGROUND-COLOR"]["dark"]["a"] = 1