feat(src):generate colors.css automatically and monitor style changes
This commit is contained in:
1 file changed
+17
+17
@@ -22,6 +22,7 @@ for log in [
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
# Generate colors.css if it doesn't exist
|
# Generate colors.css if it doesn't exist
|
||||||
colors_css_path = get_relative_path("shared/styles/colors.css")
|
colors_css_path = get_relative_path("shared/styles/colors.css")
|
||||||
if not os.path.exists(colors_css_path):
|
if not os.path.exists(colors_css_path):
|
||||||
@@ -41,6 +42,7 @@ def main():
|
|||||||
deskwidget = Deskwidgets()
|
deskwidget = Deskwidgets()
|
||||||
dock = Dock()
|
dock = Dock()
|
||||||
osd = OSDWindow()
|
osd = OSDWindow()
|
||||||
|
|
||||||
# Monitor CSS files for changes
|
# Monitor CSS files for changes
|
||||||
css_file = monitor_file(get_relative_path("shared/styles"))
|
css_file = monitor_file(get_relative_path("shared/styles"))
|
||||||
_ = css_file.connect("changed", lambda *_: set_css())
|
_ = css_file.connect("changed", lambda *_: set_css())
|
||||||
@@ -64,6 +66,21 @@ def main():
|
|||||||
|
|
||||||
app.set_css = set_css
|
app.set_css = set_css
|
||||||
app.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()
|
app.run()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user