-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgui_app.py
More file actions
85 lines (67 loc) · 2.25 KB
/
Copy pathgui_app.py
File metadata and controls
85 lines (67 loc) · 2.25 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
"""
ALOS — GUI Launcher v2.0
Starts the ALOS desktop application — Claude Code-style AI assistant.
Run:
python gui_app.py
Keyboard shortcuts inside the app:
Ctrl+P — Command Palette
Ctrl+L — Clear chat
Ctrl+, — Settings
Enter — Send message
Shift+Enter — Newline in input
"""
import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
from PyQt6.QtWidgets import QApplication, QSplashScreen
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QPixmap, QColor, QPainter, QFont
def _make_splash() -> QSplashScreen:
"""Create a minimal dark splash screen while ALOS loads."""
px = QPixmap(480, 240)
px.fill(QColor("#000C1A"))
painter = QPainter(px)
painter.setPen(QColor("#00E5FF"))
font = QFont("Consolas", 36, QFont.Weight.Bold)
painter.setFont(font)
painter.drawText(px.rect(), Qt.AlignmentFlag.AlignCenter, "ALOS")
painter.setPen(QColor("#4A7A9B"))
font2 = QFont("Segoe UI", 11)
painter.setFont(font2)
painter.drawText(
px.rect().adjusted(0, 80, 0, 0),
Qt.AlignmentFlag.AlignCenter,
"Advanced Local Operating System · Loading…"
)
painter.end()
splash = QSplashScreen(px, Qt.WindowType.WindowStaysOnTopHint)
return splash
def main():
QApplication.setHighDpiScaleFactorRoundingPolicy(
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
)
app = QApplication(sys.argv)
app.setApplicationName("ALOS")
app.setApplicationVersion("2.0.0")
app.setOrganizationName("SandyBollavram")
app.setQuitOnLastWindowClosed(False)
# Show splash while importing heavy modules
splash = _make_splash()
splash.show()
app.processEvents()
from gui.main_window import ALOSMainWindow
window = ALOSMainWindow()
# Also start system tray (optional — graceful if tray_icon import fails)
try:
from gui.tray_icon import ALOSTrayIcon
tray = ALOSTrayIcon(parent=window)
tray.show_window.connect(window.show)
tray.brief.connect(lambda: window._on_command("/brief"))
tray.exit_app.connect(app.quit)
except Exception:
pass
splash.finish(window)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()