-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmain.py
More file actions
67 lines (52 loc) · 1.6 KB
/
main.py
File metadata and controls
67 lines (52 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import setproctitle
from fabric import Application
from fabric.utils import get_relative_path, monitor_file
from loguru import logger
from config.data import APP_NAME
from modules.dock import Dock
from modules.launcher.main import Launcher
from modules.notification.notification import ModusNoti
from modules.osd import OSD
from modules.panel.main import Panel
from modules.switcher import ApplicationSwitcher
from modules.widget import Deskwidgets
# from modules.corners import Corners
for log in [
"fabric",
"services",
"utils",
# "modules",
]:
logger.disable(log)
if __name__ == "__main__":
setproctitle.setproctitle(APP_NAME)
# Load configuration
from config.data import load_config
# About().toggle(None)
config = load_config()
panel = Panel()
# corners = Corners()
dock = Dock()
modusnoti = ModusNoti()
switcher = ApplicationSwitcher()
launcher = Launcher()
panel.launcher = launcher
osd = OSD()
widgets = Deskwidgets()
# Set corners visibility based on config
# corners_visible = config.get("corners_visible", True)
# corners.set_visible(corners_visible)
# Monitor CSS files for changes
css_file = monitor_file(get_relative_path("styles"))
_ = css_file.connect("changed", lambda *_: set_css())
# Make sure corners is added to the app
app = Application(
f"{APP_NAME}", panel, dock, switcher, launcher, modusnoti, osd, widgets
)
def set_css():
app.set_stylesheet_from_file(
get_relative_path("main.css"),
)
app.set_css = set_css
app.set_css()
app.run()