forked from Kunsi/pygtk-atem-switcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·43 lines (29 loc) · 873 Bytes
/
main.py
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
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
import logging
from os import environ
from gi.repository import Gtk
from rtoml import load
from gui import ZeeveeSwitcherGui
from switcher import ZeeveeSwitcher
LOGLEVELS = {
"debug": logging.DEBUG,
"error": logging.ERROR,
"info": logging.INFO,
"warn": logging.WARNING,
}
def main():
with open(environ.get("SWITCHER_CONFIG", "config.toml")) as f:
config = load(f)
settings = Gtk.Settings.get_default()
for k, v in config.get("gtk-settings").items():
settings.set_property(
k, v
) # TODO find out if we can just pass a dict somewhere
logging.basicConfig(**config.get("logging", {}))
switcher = ZeeveeSwitcher(config)
gui = ZeeveeSwitcherGui(config, switcher)
gui.main_loop()
if __name__ == "__main__":
main()