forked from coder0-code/BlobeVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.py
109 lines (94 loc) · 3.19 KB
/
installer.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
from textual.app import App, ComposeResult
from textual.screen import Screen
from textual.containers import Horizontal, Vertical
from textual.widgets import Footer, Header, SelectionList, Label, Button, Markdown, Select, Static, Switch
### JSON Exporter ###
def savejson(json):
with open('options.json', 'w') as f:
f.write(str(json).replace("'", '"').replace("True", "true").replace("False", "false"))
#####################
Head="""
# BlobeVM Installer
> BlobeVM (Powered by DesktopOnCodespaces)
BlobeVM is a Virtual Machine that...
* Runs entirely in a web browser
* Is unblocked
* Has Windows app support
* Has audio support
* Can run games with almost no lag
* Can Bypass School Network
* Is very fast
"""
InstallHead="""
# BlobeVM Installer
"""
LINES = ["KDE Plasma (Heavy)", "XFCE4 (Lightweight)", "I3 (Very Lightweight)", "GNOME 42 (Very Heavy)", "Cinnamon", "LXQT"]
class InstallScreen(Screen):
CSS_PATH = "installer.tcss"
def compose(self) -> ComposeResult:
yield Header()
yield Markdown(InstallHead)
yield Horizontal (
Vertical (
Label("Default Apps (you should keep them)"),
SelectionList[int](
("Wine", 0, True),
("Chrome", 1, True),
("Xarchiver", 2, True),
("Discord", 3, True),
("Steam", 4, True),
("Minecraft", 5, True),
id="defaultapps"
),),
Vertical (
Label("Programming"),
SelectionList[int](
("OpenJDK 8 (jre)", 0),
("OpenJDK 17 (jre)", 1),
("VSCodium", 2),
("Zed", 3),
id="programming"
),),
Vertical (
Label("Apps"),
SelectionList[int](
("VLC", 0),
("LibreOffice", 1),
("Synaptic", 2),
("AQemu (VMs)", 3),
("TLauncher", 4),
id="apps"
),),
)
yield Vertical (
Horizontal(
Label("\nDesktop Environement :"),
Select(id="de", value="KDE Plasma (Heavy)", options=((line, line) for line in LINES)),
),)
yield Horizontal (
Button.error("Back", id="back"),
Button.warning("Install NOW", id="in"),
)
def on_button_pressed(self, event: Button.Pressed) -> None:
if event.button.id == "back":
app.pop_screen()
if event.button.id == "in":
data = {"defaultapps": self.query_one("#defaultapps").selected, "programming": self.query_one("#programming").selected, "apps": self.query_one("#apps").selected, "enablekvm": True, "DE": self.query_one("#de").value}
savejson(data)
app.exit()
class InstallApp(App):
CSS_PATH = "installer.tcss"
def compose(self) -> ComposeResult:
yield Header()
yield Markdown(Head)
yield Vertical (
Button.success("Install", id="install"),
)
def on_button_pressed(self, event: Button.Pressed) -> None:
if event.button.id == "cancel":
print("")
if event.button.id == "install":
self.push_screen(InstallScreen())
if __name__ == "__main__":
app = InstallApp()
app.run()