-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm_kit.sh
272 lines (248 loc) · 5.6 KB
/
m_kit.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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#!/data/data/com.termux/files/usr/bin/bash
#@Author prince kumar
#@ Date 21 feb 2020
#Start ------------
#Define some colour code---
r="\e[31;1m"
o="\e[32;1m"
g="\e[33;1m"
pu="\e[35;1m"
w="\e[0;1m"
#Color coding end here
#Make a function to exit the program ---
user_intrupt(){
echo -e "${r} ______Exiting M_KIT _______"
sleep 1
exit
}
#Trap user signal
trap user_intrupt SIGINT
trap user_intrupt SIGTSTP
sfs="/data/data/com.termux/files/home"
#Make a function to update the repo...
up_repo(){
git pull https://github.com/princekrvert/m_kit.git > /dev/null 2>&1
clear
}
up_repo
#install all requirememts--------
req(){
apt update && apt upgrade
apt-get install zsh
pkg install curl
pkg install golang -y
go install github.com/charmbracelet/gum@latest
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
}
req
#Change z shell to default----
c_shell(){
cd -s $(which zsh)
echo -e "${r} Default shell changed to zsh"
#Or add zsh
chsh -s zsh
}
c_shell
#Shell changing function complete----
clear
#Make a banner for the m kit tool
banner(){
clear
echo -e "${g}
__ __ _ _____ _____
| \/ | | |/ /_ _|_ _|
| |\/| | | ' / | | | |
| | | | | . \ | | | |
|_| |_|___|_|\_\___| |_|
|_____|${w} MADE BY PRINCE
"
}
banner
#make a function for setup the theme ----
theme(){
thm=$1
cd ~
sed -i '/ZSH_THEME=/d' .zshrc
sed -i "24i ZSH_THEME=\"$1\"" .zshrc
echo -e "Theme slected $1 "
termux-reload-settings
theme_menue
}
#Make a manue for the oh my z shell
theme_menue(){
echo -e "${pu}ZSH THEME slection "
echo -e "\n"
echo -e "${g}[${o}01${g}] ${w} Default"
echo -e "${g}[${o}02${g}] ${w} af-magic"
echo -e "${g}[${o}03${g}] ${w} afowler"
echo -e "${g}[${o}04${g}] ${w} agnoster"
echo -e "${g}[${o}05${g}] ${w} alanpeabody"
echo -e "${g}[${o}06${g}] ${w} amuse"
echo -e "${g}[${o}07${g}] ${w} apple"
echo -e "${g}[${o}08${g}] ${w} arrow"
echo -e "${g}[${o}09${g}] ${w} Powerlevel10k"
echo -e "${g}[${o}10${g}] ${w} bira"
echo -e "${g}[${o}11${g}] ${w} blinks"
echo -e "${g}[${o}12${g}] ${w} candy"
echo -e "${g}[${o}13${g}] ${w} cloud"
echo -e "${g}[${o}14${g}] ${w} custum"
echo -e "${g}[${o}15${g}] ${w} Go Ahead"
echo " "
#Handle user input --------
echo -ne "${o}[${r}~${o}] ${w} Select any : "
read t_optn # Theme option-----
case $t_optn in
01 | 1)
echo " "
echo -e "${r} Default ";;
02 | 2)
echo " "
theme af-magic
;;
03 | 3)
echo ""
theme afowler;;
04 | 4)
echo " "
theme agnoster;;
05 | 5)
echo " "
theme alanpeabody;;
06 | 6)
echo " "
theme amuse;;
07 | 7)
echo " "
theme apple
;;
08 | 8)
echo " "
theme arrow;;
09 | 9)
echo " "
echo -e "${r} Powlerlevel10k"
cd ~
rm -rf powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
;;
10)
echo " "
theme bira ;;
11)
echo " "
theme blink;;
12)
echo " "
theme camdy;;
13)
echo " "
theme cloud;;
14)
echo " "
echo -e "${o}[${r}~${o}] ${g} Enter name of theme: "
read t_name
theme $t=name ;;
15)
echo ""
*)
echo -e "${r} Invalid option";;
esac
#Now change the termux backgeound-----
#Make a function to handle user background choise---
}
theme_menue
back(){
#NOw we wiil change the background ..
colour=$1
cd ~
cd .termux
# NOw edit the color properties
sed -i "/background/ s/\#[0-9|a-z]*/$colour/" colors.properties
termux-reload-settings
# now make a system to call itself if changes is made
change_back
}
#NOw make a function to change the background colour..
change_back(){
# This function will change the background of the termux
# use gum to display the background options .
# Make some slab to choose the background
option=$(gum choose "black" "Light_black" "Solorized_dark" "Aurora" "dark_blue" "Dark_gray" "White" "Light_green" "Monokai" "Light_purple" "Go_ahead")
# Apply the if and else the to apply the changes ...
if [[ $option == "black" ]];then {
back "#080808"
}
elif [[ $option == "Aurora" ]];then {
back "#bf616a"
}
elif [[ $option == "Light_black" ]];then {
back "#1c1b1b"
}
elif [[ $option == "Solorized_dark" ]];then {
back "#002b36"
}
elif [[ $option == "dark_blue" ]];then {
back "#030c1c"
}
elif [[ $option == "Monokai" ]];then {
back "#E6DB74"
}
elif [[ $option == "Dark_gray" ]];then {
back "#A9A9A9"
}
elif [[ $option == "White" ]];then {
back "#cdcdd4"
}
elif [[ $option == "Light_green" ]];then {
back "#387844"
}
elif [[ $option == "Light_purple" ]];then {
back "#aa47b5"
}
elif [[ $option == "Go_ahead" ]];then
{
# now proceeed futher because the changes has been made
echo -ne ""
}
else {
echo -ne "\033[31;1m Invalid options "
}
fi
}
# Make a function to change the foreground colour ..
change_f(){
# move into the desire directory to change the colour ..
colour=$1
cd ~
cd .termux
# NOw edit the color properties
sed -i "/foreground/ s/\#[0-9|a-z]*/$colour/" colors.properties
termux-reload-settings
# now make a system to call itself if changes is made
chage_fore
}
# make a function to change the foreground colour
chage_fore(){
# now make selection menue
optionf=$(gum choose "Red" "Green" "Pink" "Go_ahead")
# now make a if else to control the statements ..
if [[ $optionf == "Red" ]];then {
## call the foreground color..
change_f "#e6151c"
}
elif [[ $optionf == "Green" ]]; then {
change_f "#2bcc1d"
}
elif [[ $optionf == "Pink" ]];then {
change_f "#da19e0"
}
elif [[ $optionf == "Go_ahead" ]]; then {
echo ""
}
}
change_back
cd ~
cd m_kit
bash f_change.sh
echo -e "${g} Please restart your termux"