Files
hyprland/config/fabric/main.py
T
2024-12-04 21:54:49 +05:45

39 lines
1.0 KiB
Python

import os
import setproctitle
from loguru import logger
from fabric import Application
from fabric.utils import get_relative_path, monitor_file
from modules import Bar, Launcher, NotificationPopup, OSDContainer
from services import Brightness, ScreenRecorder
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()
brightness = Brightness()
logger.disable("fabric.hyprland.widgets")
bar = Bar()
launcher = Launcher()
launcher.hide()
osd = OSDContainer()
notif = NotificationPopup()
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()