forked from KasRoudra/stylishtermux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·104 lines (99 loc) · 3.39 KB
/
install.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
#!/data/data/com.termux/files/usr/bin/bash
black='\033[0;30m'
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
purple='\033[0;35m'
cyan='\033[0;36m'
white='\033[0;37m'
info="${cyan}[${white}+${cyan}] ${yellow}"
ask="${cyan}[${white}?${cyan}] ${purple}"
error="${cyan}[${white}!${cyan}] ${red}"
success="${cyan}[${white}√${cyan}] ${green}"
clear
cat <<- EOF
╔═══╗╔╗────╔╗────╔╗╔════╗
║╔═╗╠╝╚╗───║║────║║║╔╗╔╗║
║╚══╬╗╔╬╗─╔╣║╔╦══╣╚╩╣║║╠╩═╦═╦╗╔╦╗╔╦╗╔╗
╚══╗║║║║║─║║║╠╣══╣╔╗║║║║║═╣╔╣╚╝║║║╠╬╬╝
║╚═╝║║╚╣╚═╝║╚╣╠══║║║║║║║║═╣║║║║║╚╝╠╬╬╗
╚═══╝╚═╩═╗╔╩═╩╩══╩╝╚╝╚╝╚══╩╝╚╩╩╩══╩╝╚╝
───────╔═╝║
───────╚══╝
EOF
chmod 777 *
if ! [[ `command -v git` ]]
then
echo -e "${info}Installing git...\n $white"
pkg install git -y
fi
if ! [[ `command -v figlet` ]]
then
echo -e "${info}Installing figlet...\n $white"
pkg install figlet -y
fi
echo -e "${info}Checking Oh-My-Zsh existence....\n $white"
sleep 1
if [ ! -d ~/.oh-my-zsh ]
then
echo -e "${error}Oh-My-Zsh not Found!\n $white"
echo -e "${info}Installing Oh-My-Zsh...\n $white"
sleep 1
pkg install zsh -y
git clone git://github.com/robbyrussell/oh-my-zsh.git "$HOME/.oh-my-zsh" --depth 1
chsh -s zsh
else
echo -e "${success}Oh-My-Zsh Found!\n $white"
sleep 1
echo -e "${info}Creating backup...\n $white"
sleep 1
cp -r ~/.zshrc /data/data/com.termux/files/usr/etc
cp -r ~/.termux/font.ttf /data/data/com.termux/files/usr/etc
fi
echo -e "${info}Installing theme....\n $white"
sleep 1
if [ -d ~/.oh-my-zsh/themes/powerlevel10k ]
then
rm -rf ~/.oh-my-zsh/themes/powerlevel10k
fi
git clone https://github.com/romkatv/powerlevel10k ~/.oh-my-zsh/themes/powerlevel10k
sleep 2
echo -e "${info}Installing plugin....\n $white"
if [ -d ~/.oh-my-zsh/plugins/zsh-autosuggestions ]
then
rm -rf ~/.oh-my-zsh/plugins/zsh-autosuggestions
fi
if [ -d ~/.oh-my-zsh/plugins/zsh-syntax-highlighting ]
then
rm -rf ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
fi
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
sleep 2
echo -e "${info}Changing font.....\n $white"
sleep 1
termux-reload-settings
cp -r font.ttf ~/.termux
sleep 1
echo -e "${ask}Enter your name to be displayed in home : ${green}"
read -p "--> " name
if [ "$name" = "" ]
then
echo -e "${error}No name...\n $white"
else
echo "figlet $name" >> "/data/data/com.termux/files/usr/etc/zshrc"
fi
echo -e "${info}Finishing installation...\n $white"
sleep 1
cp -r .zshrc ~
cp -r .p10k.zsh ~
rm -rf ~/../usr/etc/motd
cp -r removeall /data/data/com.termux/files/usr/bin
echo -e "${info}Use 'removeall' to remove theme, plugin and restore backup\n $white"
sleep 1
echo -e "${success}Installation complete!\n $white"
sleep 1
echo -e "${info}You can change theme configuration by 'p10k configure'\n $white"
sleep 1
echo -e "${success}Restart Termux to see effects!\n $white"