-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvoidboost.py
More file actions
executable file
·184 lines (144 loc) · 4.53 KB
/
voidboost.py
File metadata and controls
executable file
·184 lines (144 loc) · 4.53 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import subprocess
import os
sysinfo = subprocess.run("uname -a", shell=True,
stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
def isRoot():
os.getuid() == 0
def xbps(pkg):
subprocess.run(f"sudo xbps-install -Sy {pkg},", shell=True,
stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
def nvidiaProprietary():
devicelist = """
1 - Nvidia 400/500 series
2 - Nvidia 600/700 series
3 - Nvidia 800+ series
"""
choice = {
"1": "nvidia390",
"2": "nvidia470",
"3": "nvidia"
}
selection = input("\n: ")
try:
xbps(choice[selection])
except KeyError():
print("Please enter a valid input(1 - 3)")
nvidiaProprietary()
def drivers():
driverlist = """
1 - Nvidia: Proprietary Driver
2 - Nvidia Nouveau - Open source driver
3 - AMD/ATI
4 - Intel
"""
selection = input("\n: ")
choice = {
"1" : nvidiaProprietary(),
"2" : "mesa-dri xf86-video-nouveau",
"3" : "mesa-dri vulkan-loader mesa-vulkan-radeon amdvlk mesa-vaapi mesa-vdpau",
"4" : "mesa-vulkan-loader mesa-vulkan-intel intel-video-accel"
}
try:
xbps(choice[selection])
except KeyError():
print("\nPlease enter a valid input")
def desktop():
desktoplist = """
1 - XFCE4
2 - KDE Plasma
3 - Gnome
4 - MATE
5 - LXDE
6 - LXQT
7 - Cinnamon
8 - İ3
9 - Budgie
10 - Enlightenment
"""
print(desktoplist)
selection = input("\n: ")
choice = {
"1" : "xfce4 xfce4-panel",
"2" : "kde5 kde5-baseapps",
"3" : "gnome gnome-apps gnome-common",
"4" : "mate mate-desktop mate-common mate-extra",
"5" : "lxde lxde-common lxde-icon-theme lxpanel",
"6" : "lxqt lxqt-panel lxqt-qtplugin lxqt-themes",
"7" : "cinnamon-all",
"8" : "i3 i3status",
"9" : "budgie-desktop",
"10" : "enlightenment e16 efl"
}
try:
xbps(choice[selection])
except KeyError():
print("Please enter a valid input")
desktop()
def loginManager():
lmlist = """
1 - SDDM
2 - GDM
3 - Lightdm
"""
selection = input(lmlist, "\n: ")
choice = {
"1" : xbps("sddm"),
"2" : xbps("gdm"),
"3" : xbps("lightdm-gtk-greeter")
}
choice.get(selection, "Please enter a valid input")
def homepage():
banner = """
,,
,,,,,,,,,,,,,,.
, ,,,,,,
*((( ,,,,
(((( ,,,,,, ,,,,
/((( ,,,,,,,, ,,,,
(((( ,,,,,, ,,,,
,(((( ,,,
(((((( (
.((((((((((((((
__ __ _______ ___ ______ _______ _______ _______ _______ _______
| | | | | | || _ | | | | |
| |_| | _ | | _ | |_| | _ | _ | _____|_ _|
| | | | | | | | | | | | | | | | |_____ | |
| | |_| | | |_| | _ || |_| | |_| |_____ | | |
| || | | | |_| | | |_____| | | |
|___| |_______|___|______||_______|_______|_______|_______| |___|
"""
print(banner)
print("Checking repositories\n")
packages = subprocess.run("sudo xbps-query", shell=True)
if "void repo nonfree\nvoid-repo-multilib\nvoid-repo-multilib-nonfree" not in packages:
print("Enabling the multilib packages\n")
xbps("void-repo-nonfree void-repo-multilib void-repo-multilib-nonfree")
else:
pass
if "dbus\nxorg" not in packages:
print("Installing and enabling dbus and xorg.")
subprocess("sudo xbps-install -Sy dbus xorg && sudo ln -s /etc/sv/dbus /var/service/ && sudo ln -s /etc/sv/xorg /var/service/",
shell=True, stdout = subprocess.DEVNULL, stderr = subprocess.STDOUT)
else:
pass
menu = """
1 - Drivers
2 - Desktop Environments
3 - Login Managers
4 - Quit and reboot
"""
print(menu)
selection = input(": ")
choice = {
"1" : drivers(),
"2" : desktop(),
"3" : loginManager(),
"4" : "quit"
}
res = choice.get(selection, "Wrong input, please enter a valid input")
if res == "Wrong input, please enter a valid input":
homepage()
if res == "4":
print("Quitting...")
subprocess.run("sudo reboot", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
break