-
-
Notifications
You must be signed in to change notification settings - Fork 308
/
Copy pathinstaller.py
106 lines (90 loc) · 3.09 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
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="""
# DesktopOnCodespaces Installer
> DesktopOnCodespaces Allow you to run grapical linux and windows apps in your codespace for free.
It Actually Have
* Windows App Support (using wine)
* Audio Support
* Root Access
* Support File Persistance
* Entierly in web browser
* Bypass School Network
* Fast VMs Using KVM (Windows and Linux)
"""
InstallHead="""
# DesktopOnCodespaces Installer
"""
LINES = ["KDE Plasma (Heavy)", "XFCE4 (Lightweight)", "I3 (Very Lightweight)"]
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),
("Brave", 1, True),
("Xarchiver", 2, True),
id="defaultapps"
),),
Vertical (
Label("Programming"),
SelectionList[int](
("OpenJDK 8 (jre)", 0),
("OpenJDK 17 (jre)", 1),
("VSCodium", 2),
id="programming"
),),
Vertical (
Label("Apps"),
SelectionList[int](
("VLC", 0),
("LibreOffice", 1),
("Synaptic", 2),
("AQemu (VMs)", 3),
("Discord", 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()