Files
hyprland/config/fabric/main.py
T
2024-12-12 13:49:33 +05:45

47 lines
1.1 KiB
Python

import os
import setproctitle
from fabric import Application
from fabric.utils import get_relative_path, monitor_file
from loguru import logger
from modules.bar.bar import Bar
from modules.launcher.launcher import Launcher
from modules.notifications import NotificationPopup
from modules.osd import OSDContainer
from services import ScreenRecorder
logger.disable("fabric.hyprland.widgets")
def apply_style(app: Application):
logger.info("[Main] CSS applied")
app.set_stylesheet_from_file(get_relative_path("styles/main.css"))
if __name__ == "__main__":
sc = ScreenRecorder()
bar = Bar()
osd = OSDContainer()
notif = NotificationPopup()
launcher = Launcher()
launcher.hide()
app = Application(
"quickbar",
bar,
launcher,
osd,
)
setproctitle.setproctitle("quickbar")
css_file = monitor_file(get_relative_path("styles"))
_ = css_file.connect("changed", lambda *_: apply_style(app))
color_css_file = monitor_file(f"/home/{os.getlogin()}/.cache/material/colors.css")
_ = color_css_file.connect("changed", lambda *_: apply_style(app))
apply_style(app)
app.run()