-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackpack.py
97 lines (76 loc) · 2.63 KB
/
backpack.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
import os
from pathlib import Path
import sys
def yaourt():
print("In order for this program to work, you need to install yaourt.")
print("Install yaourt? (y/n)")
if(input() == 'y'):
os.system("pacman -S yaourt")
else:
print("Terminating program...")
sys.exit()
def install(program):
print("installing " + program)
# try:
os.system("yaourt -S --noconfirm " + program)
# except :
def main():
devTools = ["base-devel",
"atom",
"discord",
"firefox-developer-edition",
"htop",
"neofetch",
"android-studio",
"virtualbox",
"micro",
"pycharm",
"spotify",
"arduino"
"ranger",
"gparted"]
yaourtFile = Path("/usr/bin/yaourt")
k = 0
if (yaourtFile.is_file() == False):
yaourt()
print("A python script by Zachary Quinn that installs preselected software on an arch-based OS")
print("")
print("yaourt is installed")
print("---------------------------------")
def options():
print("OPTIONS:")
print("'l' to list default packages")
print("'h' for list of available options")
print("'a' to install all programs")
print("'s' to search for a package via yaourt")
print("'[name of program]' to install a program. (warning: --noconfirm option set by defualt)")
print("'q' to quit.")
options()
decision = input()
os.system("clear")
while(decision != 'q'):
if (decision == 'l'):
for i in devTools:
print(i)
elif (decision == 'a'):
print("getting gpg keys for libc++ (for discord)")
os.system("gpg -recv-keys 0fC3042E345AD05D")
for j in devTools:
print("installing " + j)
os.system("yaourt -S --noconfirm " + j)
elif (decision == 'q'):
print("terminating program...")
sys.exit()
elif (decision == 'h'):
options()
elif (decision == 's'):
print("please enter what you would like to search for here: ")
decision = input()
print("searching for '" + decision + "'")
os.system("yaourt -Ss " + decision)
else:
print("attempting to install " + decision + "...")
os.system("yaourt -S --noconfirm " + decision)
decision = input("please enter a command: ")
if __name__ == "__main__":
main()