-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
108 lines (99 loc) · 2.51 KB
/
setup.sh
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
#!/bin/bash
# Define ANSI color codes and relevant names
COLORS=("32" "33" "33" "32" "35" "34" "36" "1;31" "1;34" "1;35" "1;36" "1;32" "1;33" "1;31" "1;35" "1;36" "1;32" "1;33" "1;31" "1;35" "1;36" "1;32" "1;33")
ASCII_ART_URL="https://raw.githubusercontent.com/tharindu899/addon/main/termux/zsh/txt/pkg.txt" # URL to your ASCII art file
NAMES=() # Initialize an empty array for step names
# Fetch the ASCII art file from the URL and add it to the NAMES array
ascii_art_text=$(curl -s "$ASCII_ART_URL")
while IFS= read -r line; do
if [ -n "$line" ]; then
# Replace % with spaces in each line
line="${line//\%/ }"
name=""
for ((i = 0; i < 3; i++)); do
read -r next_line
next_line="${next_line//\%/ }"
name="$name$next_line\n"
done
NAMES+=("$name")
fi
done <<< "$ascii_art_text"
# Automatically calculate the number of steps
NUM_STEPS=${#NAMES[@]}
setup () {
for ((i = 0; i < NUM_STEPS; i++)); do
color_code="\033[${COLORS[$i]}m"
name=${NAMES[$i]}
clear
printf "\n\n $color_code$name \033[0m\n\n"
case $i in
0)
apt update -y
;;
1)
apt upgrade
;;
2)
apt install python -y
;;
3)
apt install figlet -y
;;
4)
apt install git -y
;;
5)
apt install wget -y
;;
6)
apt install zsh -y
;;
7)
apt install curl -y
;;
8)
apt install lsd -y
;;
9)
apt install micro -y
;;
10)
pkg install zip -y
;;
11)
pkg install logo-ls -y
;;
12)
pkg install ruby -y
;;
13)
gem install lolcat
;;
14)
curl -sL https://raw.githubusercontent.com/bajrangCoder/acode-plugin-acodex/main/installServer.sh | bash
;;
15)
pkg install openssh
;;
esac
sleep 1
clear
done
cd $PREFIX/bin
rm -rf zsh2
echo "#!/data/data/com.termux/files/usr/bin/sh" >> zsh2
echo "bash ~/x-theme/zsh.sh" >> zsh2
chmod 777 zsh2
rm -rf add
echo "#!/data/data/com.termux/files/usr/bin/sh" >> add
echo "bash ~/.termux/add.sh" >> add
chmod 777 add
rm -rf e
echo "#!/data/data/com.termux/files/usr/bin/sh" >> e
echo "killall -9 com.termux" >> e
chmod 777 e
bash ~/x-theme/zsh.sh
printf "\n\n\033[0;33m Now you can use\033[0m:- \033[0;31m zsh2\033[0m\n"
printf " \033[0;33m Now you can use to create alias\033[0m:- \033[0;31m add\033[0m\n"
}
setup