-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.py
More file actions
54 lines (46 loc) · 1.45 KB
/
loader.py
File metadata and controls
54 lines (46 loc) · 1.45 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
from gi.repository import Gdk, Gtk, GLib
from bar import ShellWindow
import json
import hashlib
from service.servicemanager import startServices
display = Gdk.Display.get_default()
n_screens = display.get_n_monitors()
config_file_path = "config.json"
with open(config_file_path, "r") as config_file:
config = json.load(config_file)
def monitors():
print("ID".center(10), "|", "Name".center(100), "|", "MD5".ljust(40))
for i in range(n_screens):
print(
str(i).center(10),
"|",
str(
f"{display.get_monitor(i).get_manufacturer()} {display.get_monitor(i).get_model()}"
).center(100),
"|",
str(
hashlib.md5(
str(
f"{display.get_monitor(i).get_manufacturer()} {display.get_monitor(i).get_model()}"
).encode()
).hexdigest()
).ljust(40),
)
def startup():
startServices()
selected_screens = config.get("screens", "all")
windows = []
if selected_screens == "all":
screens_to_use = range(n_screens)
else:
screens_to_use = selected_screens
for screen in screens_to_use:
if int(screen) < n_screens:
pass
windows.append(
ShellWindow(
display.get_monitor(int(screen)),
config["indicators"],
config["position"],
)
)