-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.py
More file actions
154 lines (143 loc) · 5.83 KB
/
Copy pathinstall.py
File metadata and controls
154 lines (143 loc) · 5.83 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
import os, time, threading
version = "1.0"
vertype = "release"
logo1 = f"""loading...
### ### #### ##### # # 222 6666 55555 #### # ####
##- ### # # # # # 2 2 6 5 # # # # #
##% ### # # ### # # 22 6666 555 ### ### ####
### #%# # # # # # 22 6 6 5 # # # #
###### #### ##### # 22222 666 5555 #### # # #
ver {version}({vertype}) by userdev265scratchandpython"""
logo2 = f"""loading...
### ### #### #### ##### # # ### 6666 55555 #### # ####
#@# ### # # # # # # # # 6 5 # # # # #
### #-# ### # # ### # # ## 6666 555 ### ### ####
### ### # # # # # # ## 6 6 5 # # # #
###### #### #### ##### # ##### 666 5555 #### # # #
ver {version}({vertype}) by userdev265scratchandpython"""
logo3 = f"""loading...
### ### #### ##### #### ##### # # ### #### 55555 #### # ####
##- ### # # # # # # # # # # 5 # # # # #
### ### ### ### # # ### # # ## #### 555 ### ### ####
### -## # # # # # # # ## # # 5 # # # #
###### #### ##### #### ##### # ##### ### 5555 #### # # #
ver {version}({vertype}) by userdev265scratchandpython"""
logo4 = f"""loading...
### ### #### ##### #### #### ##### # # ### #### ##### #### # ####
##- ### # # # # # # # # # # # # # # # # # #
### ### ### ### #### # # ### # # ## #### ### ### ### ####
### -## # # # # # # # # # ## # # # # # # #
###### #### ##### # # #### ##### # ##### ### #### #### # # #
ver {version}({vertype}) by userdev265scratchandpython"""
def loading_animation():
while run_check:
print(logo1)
time.sleep(1)
os.system("clear")
print(logo2)
time.sleep(0.25)
os.system("clear")
print(logo3)
time.sleep(0.25)
os.system("clear")
print(logo4)
time.sleep(1)
os.system("clear")
print(logo3)
time.sleep(0.25)
os.system("clear")
print(logo2)
time.sleep(0.25)
os.system("clear")
user = os.getlogin()
if os.path.exists(f"/home/{user}/.config/alacritty/alacritty.toml"):
os.system(f"mv /home/{user}/.config/alacritty/alacritty.toml /home/{user}/.config/alacritty/alacritty.toml.old")
os.system("""echo "[font]" > ~/.config/alacritty/alacritty.toml ; echo "size = 5.0" >> ~/.config/alacritty/alacritty.toml""")
os.system(f"mkdir /home/{user}/yay ; sudo chmod 777 /home/{user}/yay")
os.system("mkdir -p /tmp/udev265sap/")
os.system("cd /tmp/udev265sap ; sudo chmod 777 /tmp/ ; sudo chmod 777 /tmp/* ; sudo touch /tmp/udev265sap/installer.sh ; sudo chmod 777 /tmp/udev265sap/installer.sh")
bash_contents = r"""
echo "installig needed components..."
sudo pacman -Syu --needed --noconfirm git base-devel > /dev/null 2>&1
git clone https://aur.archlinux.org/yay.git > /dev/null 2>&1
cd yay
makepkg -si
clear
yay -Syu --noconfirm --needed neofetch i3wm sway foot alacritty
clear
mkdir -p ~/.config/alacritty
clear
echo "installed needed components"
ask_catppuccin_palette() {
clear
echo 1 - Latté
echo 2 - Frappé
echo 3 - Macchiato
echo 4 - Mocha
read -n 1 -s -r -p "Which palette of catppuccin-mocha do you want?" palette
if [[ $palette == "1" ]]; then
cd alacritty
cp ./catppuccin-latte.toml ~/.config/alacritty/catppuccin.toml
elif [[ $palette == "2" ]]; then
cd alacritty
cp ./catppuccin-frappe.toml ~/.config/alacritty/catppuccin.toml
elif [[ $palette == "3" ]]; then
cd alacritty
cp ./catppuccin-macchiato.toml ~/.config/alacritty/catppuccin.toml
elif [[ $palette == "4" ]]; then
cd alacritty
cp ./catppuccin-mocha.toml ~/.config/alacritty/catppuccin.toml
else
ask_catppuccin_palette
fi
echo -n "making config... "
echo [font] > ~/.config/alacritty/alacritty.toml
echo size = 5.0 >> ~/.config/alacritty/alacritty.toml
echo "[general]" >> ~/.config/alacritty/alacritty.toml
echo "import = [\"$HOME/.config/alacritty/catppuccin.toml\"]" >> ~/.config/alacritty/alacritty.toml
echo "[env]" >> ~/.config/alacritty/alacritty.toml
echo "TERM = \"xterm-256color\"" >> ~/.config/alacritty/alacritty.toml
echo "done"
return
}
ask_install_catppuccin() {
echo "saying yes(pressing y) will cause installation of catppuccin to alacritty. Some things can ONLY be done by user."
echo
read -n 1 -r -p "Do you want to proceed? (y/n)" catppuccin
if [[ $catppuccin == "y" || $catppuccin == "Y" ]]; then
git clone https://github.com/catppuccin/alacritty.git > /dev/null 2>&1
ask_catppuccin_palette
return
elif [[ $catppuccin == "n" || $catppuccin == "N" ]]; then
echo -n "making config... "
echo [font] > ~/.config/alacritty/alacritty.toml
echo size = 5.0 >> ~/.config/alacritty/alacritty.toml
echo "[env]" >> ~/.config/alacritty/alacritty.toml
echo "TERM = \"xterm-256color\"" >> ~/.config/alacritty/alacritty.toml
echo "done"
return
else
ask_install_catppuccin
fi
}
ask_install_catppuccin
sleep 1
clear
"""
def make_file():
global run_check
run_check = True
os.system("touch installer.sh")
for I in bash_contents:
with open("installer.sh", "a") as a:
a.write(I)
time.sleep(60/len(bash_contents))
run_check = False
loading_thread = threading.Thread(target=make_file)
loading_thread.daemon = True
loading_thread.start()
loading_animation()
os.system("clear")
os.system("sudo mv ./installer.sh /tmp/udev265sap/installer.sh ; sudo chmod +x /tmp/udev265sap/installer.sh ; bash /tmp/udev265sap/installer.sh")
time.sleep(1)
os.system("sudo rm -rf /tmp/udev265sap")