-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHypr_UNINSTALL
executable file
·153 lines (128 loc) · 4.71 KB
/
Hypr_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
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
#!/bin/bash
# UNINSTALL SCRIPT FOR THE DEFAULT THEME
source ./Colors
DIR_PATH="$(dirname "$(realpath "$0")")"
ask_remove() {
echo -ne "${BLUE}\nRemove $1? (Y/n) ${NC}"
read -r resp
[[ "$resp" =~ ^[Yy]$ ]]
}
install_yay() {
echo -e "${YELLOW}Installing dependencies for yay...${NC}"
sudo pacman -S --noconfirm git base-devel
echo -e "${YELLOW}Installing yay...${NC}"
git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm
cd ..
rm -rf yay
echo -e "${GREEN}Yay installed.${NC}"
}
# Main menu
echo -e "${BLUE}Choose an option:${NC}"
echo "1. Selectively uninstall"
echo "2. Delete whole theme configs with all tools (Not Recommended)"
read -p "Enter your choice (1 or 2): " uninstall_choice
case $uninstall_choice in
1)
# Selective uninstall
echo -e "${YELLOW}Performing selective uninstallation...${NC}"
# Neovim
if ask_remove "Neovim"; then
sudo pacman -Rns --noconfirm neovim ttf-jetbrains-mono-nerd
if ask_remove "Neovim config"; then
sudo rm -rf ~/.config/nvim /root/.config/nvim 2>/dev/null
fi
fi
# Vim Configuration
if ask_remove "Vim config"; then
sudo rm -rf ~/.vimrc /root/.vimrc 2>/dev/null
fi
# Waybar Configuration
if ask_remove "Waybar configs"; then
rm -rf ~/.config/waybar/ 2>/dev/null
fi
# Wlogout Configuration
if ask_remove "Wlogout configs"; then
rm -rf ~/.config/wlogout/ 2>/dev/null
fi
# Alacritty Configuration
if ask_remove "Alacritty configs"; then
rm -rf ~/.config/alacritty/ 2>/dev/null
fi
# Neofetch Configuration
if ask_remove "Neofetch configs"; then
rm -rf ~/.config/neofetch/ 2>/dev/null
fi
# Swaylock Configuration
if ask_remove "Swaylock configs"; then
rm -rf ~/.config/swaylock/ 2>/dev/null
fi
# Wofi Configuration
if ask_remove "Wofi configs"; then
rm -rf ~/.config/wofi/ 2>/dev/null
fi
# Wallpapers
if ask_remove "Wallpapers"; then
rm -rf ~/.config/wall 2>/dev/null
fi
# Additional Tools installed using Yay
if ! command -v yay >/dev/null 2>&1; then
read -p "Yay is not installed. Do you want to install yay? (Y/n) " install_yay_resp
if [[ "$install_yay_resp" =~ ^[Yy]$ ]]; then
install_yay
else
echo -e "${YELLOW}Skipping yay tools removal as yay is not installed.${NC}"
fi
fi
if command -v yay >/dev/null 2>&1; then
for tools in swaylock swayidle wlogout swww; do
if ask_remove "$tools"; then
yay -Rns --noconfirm $tools
fi
done
fi
# Requirements
if ask_remove "Requirements"; then
sudo pacman -R --noconfirm yay
sudo pacman -Rns --noconfirm $(cat "$DIR_PATH"/Requirements/Requirements.txt)
fi
# Custom Tools
if ask_remove "custom tools in /usr/bin"; then
sudo rm -f /usr/bin/lock /usr/bin/switch-wall 2>/dev/null
fi
# Zsh Setup
if ask_remove "Zsh setup"; then
sudo rm -rf ~/.zshrc* /root/.zshrc* 2>/dev/null
fi
;;
2)
# Complete removal
echo -e "${YELLOW}Performing complete removal...${NC}"
sudo rm -rf /root/.config/nvim ~/.config/nvim ~/.config/waybar ~/.config/wlogout ~/.config/alacritty ~/.config/neofetch ~/.config/swaylock ~/.config/wofi ~/.config/wall
sudo rm -rf ~/.vimrc /root/.vimrc
sudo rm -f /usr/bin/lock /usr/bin/switch-wall
echo -e "${GREEN}Whole theme and tools removed.${NC}"
# Additional Tools installed using Yay
if ! command -v yay >/dev/null 2>&1; then
read -p "Yay is not installed. Do you want to install yay? (Y/n) " install_yay_resp
if [[ "$install_yay_resp" =~ ^[Yy]$ ]]; then
install_yay
else
echo -e "${YELLOW}Skipping yay tools removal as yay is not installed.${NC}"
fi
fi
if command -v yay >/dev/null 2>&1; then
for tools in swaylock swayidle wlogout swww; do
if ask_remove "$tools"; then
yay -Rns --noconfirm $tools
fi
done
fi
sudo pacman -R --noconfirm yay
sudo pacman -Rns --noconfirm $(cat "$DIR_PATH"/Requirements/Requirements.txt)
;;
*)
echo -e "${RED}Invalid choice. Exiting.${NC}"
exit 1
;;
esac
echo -e "${GREEN}Uninstallation process completed.${NC}"