From 202cc9c6af0029dee32bb05ce9ac4d6e486effb1 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 10 Apr 2026 18:40:26 +0545 Subject: [PATCH] feat(src):generate colors.css automatically and monitor style changes --- src/main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.py b/src/main.py index 16586da..12c3545 100644 --- a/src/main.py +++ b/src/main.py @@ -22,6 +22,7 @@ for log in [ def main(): + # Generate colors.css if it doesn't exist colors_css_path = get_relative_path("shared/styles/colors.css") if not os.path.exists(colors_css_path): @@ -41,6 +42,7 @@ def main(): deskwidget = Deskwidgets() dock = Dock() osd = OSDWindow() + # Monitor CSS files for changes css_file = monitor_file(get_relative_path("shared/styles")) _ = css_file.connect("changed", lambda *_: set_css()) @@ -64,6 +66,21 @@ def main(): app.set_css = set_css app.set_css() + + # Inject into the executing module's namespace (__main__) + # to emulate what happened when this file was run directly. + # This allows fabric-cli exec to execute commands flawlessly. + import __main__ + + __main__.app = app + __main__.switcher = switcher + __main__.panel = panel + __main__.modusnoti = modusnoti + __main__.launcher = launcher + __main__.deskwidget = deskwidget + __main__.dock = dock + __main__.osd = osd + app.run()