-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
47 lines (34 loc) · 1.22 KB
/
setup.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
import os
themes = ["orzklv", "shahruz"]
tpm_path = "~/.config/tmux/plugins/tpm"
p = os.path
def configure(index):
os.system(f"cp {themes[index]}/* ~/.config -r")
os.system("mkdir -p ~/.fonts")
os.system("cp fonts/* ~/.fonts -r")
os.system("cp dunst tmux wallpaper.jpg ~/.config -r")
if (p.exists(p.expanduser(tpm_path))):
os.system(f"rm -rf {tpm_path}")
os.system(f"git clone https://github.com/tmux-plugins/tpm {tpm_path}")
theme_question = ""
for index, element in enumerate(themes):
theme_question += f"[{index}] {element} "
try:
print("Which theme do you want to install?\n")
print(theme_question)
theme_index = int(input("Enter theme index: "))
if theme_index >= len(themes):
print(f"\nEnter only 1..{len(themes)}!")
exit()
packages = ""
with open(f"{themes[theme_index]}/requirements.txt", "r") as file:
lines = file.readlines()
for line in lines:
packages += line.strip() + " "
if len(packages) > 0:
os.system(f"sudo pacman -S {packages}")
configure(theme_index)
except ValueError:
print(f"Enter only 0..{len(themes)-1}")
except FileNotFoundError as e:
print(f"\n{e.filename} not found!")