-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (43 loc) · 1.64 KB
/
main.py
File metadata and controls
56 lines (43 loc) · 1.64 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
import sys
import os
import subprocess
import thetime
import json
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
from PyQt5.QtCore import Qt, QTime, QTimer, QObject
# from PyQt5.QtWidgets import QWidget i meant QObject im dumb
configPath = os.path.expanduser('~/.config/AzuOS/Dock')
taskbarContents = os.path.expanduser('~/.config/AzuOS/Dock/Contents')
startMenuContents = os.path.expanduser('~/.config/AzuOS/StartMenu/PinnedApps')
if not os.path.exists(configPath):
print('"~/.config/AzuOS/Dock" Created')
os.makedirs(configPath, exist_ok=True)
if not os.path.exists(taskbarContents):
print('"~/.config/AzuOS/Dock/Contents" Created')
os.makedirs(taskbarContents, exist_ok=True)
if not os.path.exists(startMenuContents):
print('"~/.config/AzuOS/StartMenu/PinnedApps" Created')
os.makedirs(pinnedAppsDirectory, exist_ok=True)
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
engine.quit.connect(app.quit)
engine.load('layouts/dock/undocked-horizontal.qml')
# engine.load('layouts/startmenu/window.qml')
root = engine.rootObjects()[0]
# time shenanigens
time = thetime.Time()
# print(time.fetch_time())
engine.rootContext().setContextProperty("systemTime", time)
# pinned apps!
# appIcon = engine.loadComponent('layouts/components/AppIcon.qml')
# this here reads a json and creates the icons and such
try:
with open(taskbarContents + '/pinned.json', 'r') as pinned:
data = json.load(pinned)
# print(json.dumps(data, indent=4))
for pos, name in data.items():
print()
except json.JSONDecodeError:
print("Failed to load pinned apps: Could not parse properly")
sys.exit(app.exec())