-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
uninstall.sh
executable file
·221 lines (182 loc) · 6.61 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
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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
CLEAR='\033[0m'
# Function to print colorful text
print_color() {
printf "%b%s%b\n" "$1" "$2" "$CLEAR"
}
# Function to print centered text
print_centered() {
local text="$1"
local color="$2"
local width=$(tput cols)
local padding=$(( (width - ${#text}) / 2 ))
printf "%b%*s%s%*s%b\n" "$color" $padding "" "$text" $padding "" "$CLEAR"
}
# Function to safely remove packages
safe_remove() {
for package in "$@"; do
if rpm -q "$package" &> /dev/null; then
sudo dnf remove -y "$package"
else
print_color $YELLOW "Package $package is not installed, skipping."
fi
done
}
# Function to safely remove COPR repositories
safe_remove_copr() {
for repo in "$@"; do
if sudo dnf copr list | grep -q "$repo"; then
sudo dnf copr remove -y "$repo"
else
print_color $YELLOW "COPR repository $repo is not enabled, skipping."
fi
done
}
# Function to safely remove directories and files
safe_remove_item() {
local item="$1"
if [ -e "$item" ]; then
rm -rf "$item"
print_color $GREEN "Removed: $item"
else
print_color $YELLOW "Item $item does not exist, skipping."
fi
}
# Function to ask user before removing an item
ask_before_remove() {
local item="$1"
read -p "Do you want to remove $item? (y/n): " choice
case "$choice" in
y|Y ) safe_remove_item "$item";;
n|N ) print_color $YELLOW "Keeping $item";;
* ) print_color $YELLOW "Invalid input. Keeping $item";;
esac
}
# Print banner
print_color $MAGENTA "UNINSTALL HYPRLAND"
print_centered "Made with ♥ by vdcds" $CYAN
# Warning message
print_color $RED "
█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█
█ █
█ ╔═╗╔╦╗╔═╗╔═╗ ┬ █
█ ╚═╗ ║ ║ ║╠═╝ │ █
█ ╚═╝ ╩ ╚═╝╩ o █
█ █
█ ╔═╗╔╗╔╔╦╗ ╦═╗╔═╗╔═╗╔╦╗ █
█ ╠═╣║║║ ║║ ╠╦╝║╣ ╠═╣ ║║ █
█ ╩ ╩╝╚╝═╩╝ ╩╚═╚═╝╩ ╩═╩╝ █
█ █
█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
!!! IMPORTANT WARNING !!!
This script will UNINSTALL Hyprland and related components.
• All Hyprland configurations will be DELETED
• Related packages will be REMOVED
• This action is IRREVERSIBLE
BEFORE PROCEEDING:
1. Ensure you have a BACKUP of any important configurations
2. Close all running applications
3. Be prepared for potential system changes
If you're unsure about any aspect of this process,
please STOP now and seek additional information.
"
# Confirmation to proceed
print_color $YELLOW "Are you ABSOLUTELY SURE you want to proceed with the uninstallation?"
read -p "Type 'yes' to continue or any other key to cancel: " confirm
if [[ $confirm != "yes" ]]; then
print_color $GREEN "Uninstallation cancelled. No changes were made to your system."
exit 1
fi
# Main uninstallation process
print_color $BLUE "Starting Hyprland uninstallation process..."
# Uninstall Hyprland and related packages
print_color $YELLOW "Removing Hyprland and related packages..."
safe_remove hyprland hyprcursor waybar kvantum polkit-gnome swappy SwayNotificationCenter wlogout kitty rofi-wayland aylurs-gtk-shell cliphist hypridle hyprlock pamixer pyprland swww
# Remove COPR repositories
print_color $YELLOW "Removing COPR repositories..."
safe_remove_copr solopasha/hyprland erikreider/SwayNotificationCenter
# Remove additional components
print_color $YELLOW "Removing additional components..."
safe_remove blueman thunar thunar-archive-plugin thunar-media-tags-plugin thunar-volman sddm xdg-desktop-portal-hyprland
# Ask before removing zsh and related packages
ask_before_remove zsh
ask_before_remove util-linux-user
ask_before_remove pokemon-colorscripts-git
# Remove ROG-related packages
safe_remove asusctl supergfxctl
# Remove fonts
print_color $YELLOW "Removing fonts..."
safe_remove 'jetbrains-mono-fonts*' 'fira-code-fonts*'
# Remove configuration files
print_color $YELLOW "Removing configuration files..."
config_items=(
~/.config/ags
~/.config/hypr
~/.config/waybar
~/.config/wofi
~/.config/dunst
~/.config/swappy
~/.config/wlogout
~/.config/kitty
~/.config/rofi
~/.config/gtk-3.0
~/.config/gtk-4.0
~/.config/xdg-desktop-portal-hyprland
~/.config/btop
~/.config/cava
~/.config/Thunar
~/.config/xfce4
~/.config/wallust
~/.zshrc
~/.p10k.zsh
/etc/environment.d/hyprland.conf
)
for item in "${config_items[@]}"; do
ask_before_remove "$item"
done
# Ask about wallpaper collection
ask_before_remove ~/Pictures/wallpapers
# Remove Fedora-Hyprland directory
ask_before_remove ~/Fedora-Hyprland
# Remove nwg-look (installed from source)
print_color $YELLOW "Removing nwg-look..."
if [ -d ~/nwg-look ]; then
cd ~/nwg-look
if [ -f Makefile ]; then
sudo make uninstall
fi
cd ~
safe_remove_item ~/nwg-look
# Remove binary if it exists
if [ -f /usr/local/bin/nwg-look ]; then
sudo rm /usr/local/bin/nwg-look
fi
print_color $GREEN "Removed nwg-look."
else
print_color $YELLOW "nwg-look directory not found, skipping."
fi
# Ask before removing Oh My Zsh
if [ -d ~/.oh-my-zsh ]; then
ask_before_remove ~/.oh-my-zsh
fi
# Clean up any leftover dependencies
print_color $YELLOW "Cleaning up leftover dependencies..."
sudo dnf autoremove -y
print_color $GREEN "Hyprland and related components have been uninstalled."
print_color $YELLOW "It's recommended to reboot your system now."
print_color $CYAN "To reset to the default Fedora desktop environment, run:"
print_color $CYAN "sudo dnf group install @workstation-product-environment"
# Final ASCII Art
print_color $MAGENTA "
THANK YOU FOR USING THIS AMAZING HYPRLAND CONFIG IN FIRST PLACE!
"
print_centered "Made by vdcds" $CYAN