forked from AvinashReddy3108/LITMux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
executable file
·101 lines (83 loc) · 3.57 KB
/
uninstall.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
#!/usr/bin/env bash
# Credits: https://gist.github.com/TrinityCoder/911059c83e5f7a351b785921cf7ecdaa#how-to-do-it
print_centered() {
[[ $# == 0 ]] && return 1
declare -i TERM_COLS="$(tput cols)"
declare -i str_len="${#1}"
[[ $str_len -ge $TERM_COLS ]] && {
echo "$1";
return 0;
}
declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
[[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
filler=""
for (( i = 0; i < filler_len; i++ )); do
filler="${filler}${ch}"
done
printf "%s%s%s" "$filler" "$1" "$filler"
[[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
printf "\n"
return 0
}
clear
tput civis
print_centered "";
print_centered "";
print_centered "██╗ ██╗████████╗███╗ ███╗██╗ ██╗██╗ ██╗";
print_centered "██║ ██║╚══██╔══╝████╗ ████║██║ ██║╚██╗██╔╝";
print_centered "██║ ██║ ██║ ██╔████╔██║██║ ██║ ╚███╔╝ ";
print_centered "██║ ██║ ██║ ██║╚██╔╝██║██║ ██║ ██╔██╗ ";
print_centered "███████╗██║ ██║ ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗";
print_centered "╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝";
print_centered "";
print_centered " Preparing to uninstall, please wait! ";
print_centered "";
print_centered "";
sleep 3
clear
# Are you sure about that?
read -r -p "Are you sure you want to go back to plain old Termux? [y/N] " confirmation
if [ "$confirmation" != y ] && [ "$confirmation" != Y ]; then
echo "Uninstall cancelled"
exit
fi
# Restores stock welcome text.
cp -fr $HOME/.oh-my-zsh/custom/misc/LitMux/motd-default $PREFIX/etc/motd
# Restore the extra bells and whistles of touch keyboard.
rm -f ~/.termux/termux.properties
# Purge Oh-My-ZSH stuff.
rm -rf ~/.oh-my-zsh
# Remove pacman wrapper.
rm -f $PREFIX/bin/pacapt
rm -f $PREFIX/bin/pacman
# Restores stock color scheme.
rm -f ~/.termux/colors.properties
# Restores stock font.
rm -f ~/.termux/font.ttf
# Purges leftover stuff.
rm -f ~/.zshrc.pre-oh-my-zsh
rm -f ~/.zshrc.omz-uninstalled*
rm -f ~/.shell.pre-oh-my-zsh
rm -f ~/.p10k.zsh*
rm -f $PREFIX/tmp/.zshrc*
# Sets BASH as the default shell
chsh -s bash
# Uninstall ZSH
pkg uninstall zsh
# Reloads termux settings
termux-reload-settings
# Goodbye.
print_centered "";
print_centered "";
print_centered "██╗ ██╗████████╗███╗ ███╗██╗ ██╗██╗ ██╗";
print_centered "██║ ██║╚══██╔══╝████╗ ████║██║ ██║╚██╗██╔╝";
print_centered "██║ ██║ ██║ ██╔████╔██║██║ ██║ ╚███╔╝ ";
print_centered "██║ ██║ ██║ ██║╚██╔╝██║██║ ██║ ██╔██╗ ";
print_centered "███████╗██║ ██║ ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗";
print_centered "╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝";
print_centered "";
print_centered " Uninstall complete, sad to say goodbye! ";
print_centered "";
print_centered "";
tput cnorm
exit 0