This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall
executable file
·73 lines (62 loc) · 2.68 KB
/
uninstall
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
#!/usr/bin/env bash
## Author : Zim Muller
## Github : @zim0369
## Reddit : @zim0369
## Gelacritty uninstall script
## ANSI Colors (FG & BG)
RED="$(printf '\033[31m')" GREEN="$(printf '\033[32m')" ORANGE="$(printf '\033[33m')" BLUE="$(printf '\033[34m')"
MAGENTA="$(printf '\033[35m')" CYAN="$(printf '\033[36m')" WHITE="$(printf '\033[37m')" BLACK="$(printf '\033[30m')"
REDBG="$(printf '\033[41m')" GREENBG="$(printf '\033[42m')" ORANGEBG="$(printf '\033[43m')" BLUEBG="$(printf '\033[44m')"
MAGENTABG="$(printf '\033[45m')" CYANBG="$(printf '\033[46m')" WHITEBG="$(printf '\033[47m')" BLACKBG="$(printf '\033[40m')"
DEFAULT_FG="$(printf '\033[39m')" DEFAULT_BG="$(printf '\033[49m')"
## Banner
banner () {
clear
echo "
${ORANGE}╭━━━┳━━━┳╮╱╱╭━━━╮
${ORANGE}┃╭━╮┃╭━━┫┃╱╱┃╭━╮┃
${ORANGE}┃┃╱╰┫╰━━┫┃╱╱┃┃╱┃┃
${ORANGE}┃┃╭━┫╭━━┫┃╱╭┫╰━╯┃
${ORANGE}┃╰┻━┃╰━━┫╰━╯┃╭━╮┃
${ORANGE}╰━━━┻━━━┻━━━┻╯╱╰╯
${ORANGE}☴ ${CYAN}T̼I̼L̼L̼ ̼I̼T̼'̼S̼ ̼G̼O̼N̼E̼ ${ORANGE}☴
${ORANGE}☴☴☴☴☴☴☴☴☴☴☴☴☴☴☴☴☴☴
"
}
## Script Termination
exit_on_signal_SIGINT () {
{ printf "\n\n%s\n" " ${BLUE}[${RED}*${BLUE}] ${RED}Script interrupted." 2>&1; echo; reset_color; }
exit 0
}
exit_on_signal_SIGTERM () {
{ printf "\n\n%s\n" " ${BLUE}[${RED}*${BLUE}] ${RED}Script terminated." 2>&1; echo; reset_color; }
exit 0
}
trap exit_on_signal_SIGINT SIGINT
trap exit_on_signal_SIGTERM SIGTERM
## Reset terminal colors
reset_color() {
tput sgr0 # reset attributes
tput op # reset color
return
}
## Check for previous installation
uninstall_tstyle () {
banner
if [[ (-L /usr/local/bin/gela) && (-d /usr/local/share/gelacritty) ]]; then
{ echo; echo " ${BLUE}[${RED}*${BLUE}] ${ORANGE}Uninstalling Gelacritty..."; echo; }
{ echo " ${BLUE}[${RED}*${BLUE}] ${RED}Removing files from '/usr/local/share' dir."${BLUE}; }
{ printf " "; sudo rm -r /usr/local/share/gelacritty /usr/local/share/fonts/gelacritty /usr/local/bin/gela; sudo fc-cache; }
# Verify files
if [[ (! -L /usr/local/bin/gela) && (! -d /usr/local/share/gelacritty) ]]; then
{ echo; echo " ${BLUE}[${RED}*${BLUE}] ${GREEN}Uninstalled Successfully."; echo; }
{ reset_color; exit 0; }
else
{ echo " ${BLUE}[${RED}!${BLUE}] ${RED}Error Occured."; echo; reset_color; exit 1; }
fi
else
{ echo; echo " ${BLUE}[${RED}!${BLUE}] ${MAGENTA}Gelacritty ${GREEN}is not installed."; echo; }
{ reset_color; exit 0; }
fi
}
uninstall_tstyle