-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmigration-uninstall.sh
More file actions
267 lines (235 loc) · 7.64 KB
/
migration-uninstall.sh
File metadata and controls
267 lines (235 loc) · 7.64 KB
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#!/bin/bash
CUR_DIR=$(pwd)
QDBUS_BIN="qdbus6"
SU_CMD=sudo
if [[ -z "$(command -v $SU_CMD)" ]]; then
SU_CMD=doas
if [[ -z "$(command -v $SU_CMD)" ]]; then
echo "Neither sudo or doas were detected on the system."
exit
fi
fi
# Sanity check to see if the proper tools are installed.
if [[ -z "$(command -v kpackagetool6)" ]]; then
echo "kpackagetool6 not found. Stopping."
exit
fi
if [[ -n "$(command -v qdbus6)" ]]; then # Arch
QDBUS_BIN=$(command -v qdbus6)
elif [[ -n "$(command -v qdbus-qt6)" ]]; then # Fedora
QDBUS_BIN=$(command -v qdbus-qt6)
else
echo "qdbus6 not found."
echo "qdbus-qt6 not found."
echo "Stopping."
exit
fi
PLASMASHELL=$($QDBUS_BIN org.kde.plasmashell /PlasmaShell shell)
if [ $PLASMASHELL == "io.gitgud.wackyideas.desktop" ]; then
echo -e "You shouldn't run the uninstall script from AeroThemePlasma itself."
echo -e "Please run the uninstall script from the Plasma session or another session."
exit
fi
BUILD_FILES=(
"plasma/sddm/login-sessions/build"
"plasma/aerothemeplasma-kcmloader/build"
"plasma/plasmoids/src/systemtray_src/build"
"plasma/plasmoids/src/notifications_src/build"
"plasma/plasmoids/src/volume_src/build"
"plasma/plasmoids/src/sevenstart_src/build"
"plasma/plasmoids/src/seventasks_src/build"
"plasma/plasmoids/src/desktopcontainment/build"
)
KWIN_EFFECTS=(
dimscreenaero
fadingpopupsaero
loginaero
seventasks-thumbnails
smodpeekeffect
squashaero
)
function uninstall_cmake_component {
if [ ! -f "$CUR_DIR/$1/install_manifest.txt" ]; then
echo -e "File install_manifest.txt in $CUR_DIR/$1 was not found."
echo -e "If this component was already removed from the system, you can ignore this message.\n"
echo -e "Otherwise, to generate this file, run the compile.sh and install_plasmoids.sh scripts again like this:"
echo -e "$ bash compile.sh --skip-libplasma [--ninja]"
echo -e "$ bash install_plasmoids.sh --skip-kpackages [--ninja]"
echo -e "Afterwards, re-run this script."
else
cd "$CUR_DIR/$1"
BUILD_TOOL=make
if [ -f "build.ninja" ]; then
BUILD_TOOL=ninja
fi
$SU_CMD $BUILD_TOOL uninstall
echo -e "Done."
cd "$CUR_DIR"
fi
}
for path in ${BUILD_FILES[@]}; do
uninstall_cmake_component "$path"
done
function uninstall_prompt {
echo -e "Do you want to uninstall: $1? (y/N)"
if [ ! -z "$2" ]; then
echo -e "The following will be removed: $2"
fi
read answer
if [ "$answer" != "${answer#[Yy]}" ]; then
return 1
else
return 0
fi
}
function uninstall_plasmoid {
PLASMOID=$(basename "$1")
if [[ $PLASMOID == 'src' ]]; then
echo "Skipping $PLASMOID"
return
fi
if [[ $PLASMOID == 'io.gitgud.wackyideas.systemtray' ]]; then
pkexec kpackagetool6 -t "Plasma/Applet" -g -r "$1"
else
kpackagetool6 -t "Plasma/Applet" -r "$1"
fi
echo -e "Uninstalled $1.\n"
cd "$CUR_DIR"
}
function uninstall_component {
COMPONENT=$(basename "$1")
kpackagetool6 -t "$2" -r "$1"
echo -e "Uninstalled $1.\n"
cd "$CUR_DIR"
}
uninstall_prompt "Plasmoids"
if [ "$?" == 1 ]; then
echo "Uninstalling plasmoids..."
for filename in "$PWD/plasma/plasmoids/"*; do
uninstall_plasmoid "$filename"
done
fi
uninstall_prompt "Plasma components"
if [ "$?" == 1 ]; then
echo "Uninstalling Plasma components..."
uninstall_component "authui7" "Plasma/LookAndFeel"
uninstall_component "io.gitgud.wackyideas.taskbar" "Plasma/LayoutTemplate"
uninstall_component "Seven-Black" "Plasma/Theme"
uninstall_component "io.gitgud.wackyideas.desktop" "Plasma/Shell"
fi
COLOR_DIR="$HOME/.local/share/color-schemes"
uninstall_prompt "Color scheme" "$COLOR_DIR/Aero.colors"
if [ "$?" == 1 ]; then
echo "Uninstalling color scheme..."
rm "$COLOR_DIR/Aero.colors"
echo "Done."
fi
KV_DIR="$HOME/.config/Kvantum"
uninstall_prompt "Kvantum theme" "$KV_DIR/Windows7Aero"
if [ "$?" == 1 ]; then
echo "Uninstalling Kvantum theme..."
kvantummanager --set KvAdapta
rm -r "$KV_DIR/Windows7Aero"
echo "Done."
fi
uninstall_prompt "Sound themes" "$(echo "$HOME/.local/share/sounds/Windows 7"*)"
if [ "$?" == 1 ]; then
echo "Uninstalling sound themes..."
for filename in "$HOME/.local/share/sounds/Windows 7"*; do
rm -r "$filename"
done
echo "Done."
fi
ICONS_DIR="$HOME/.local/share/icons"
uninstall_prompt "Icon theme" "$ICONS_DIR/Windows 7 Aero"
if [ "$?" == 1 ]; then
echo "Uninstalling icon theme..."
rm -r "$ICONS_DIR/Windows 7 Aero"
echo "Done."
fi
MIMETYPE_DIR="$HOME/.local/share/mime/packages"
uninstall_prompt "Mimetypes" "$MIMETYPE_DIR/application-vnd.microsoft.portable-executable.xml application-x-ms-dll.xml application-x-msdownload.xml application-x-ms-ne-executable.xml"
if [ "$?" == 1 ]; then
echo "Uninstalling mimetypes..."
for filename in "$PWD/misc/mimetype/"*; do
MIME=$(basename $filename)
rm "$MIMETYPE_DIR/$MIME"
done
update-mime-database "$HOME/.local/share/mime"
echo "Done."
fi
uninstall_prompt "KWin JS effects"
if [ "$?" == 1 ]; then
echo "Uninstalling KWin effects (JS)..."
for entry in ${KWIN_EFFECTS[@]}; do
uninstall_component "$entry" "KWin/Effect"
done
echo "Done."
fi
uninstall_prompt "KWin scripts"
if [ "$?" == 1 ]; then
echo "Uninstalling KWin scripts..."
uninstall_component "smodpeekscript" "KWin/Script"
echo "Done."
fi
uninstall_prompt "KWin task switchers"
if [ "$?" == 1 ]; then
echo "Uninstalling KWin task switchers..."
uninstall_component "flip3d" "KWin/WindowSwitcher"
uninstall_component "thumbnail_seven" "KWin/WindowSwitcher"
echo "Done."
fi
KWIN_DIR="$HOME/.local/share/kwin"
echo "Uninstalling KWin outline"
rm -r "$KWIN_DIR/outline"
if [[ -L "$KWIN_DIR-x11" && -d "$KWIN_DIR-x11" ]]; then
echo "kwin-x11 folder is a symlink, remove it."
rm "$KWIN_DIR-x11"
fi
if [[ -L "$KWIN_DIR-wayland" && -d "$KWIN_DIR-wayland" ]]; then
echo "kwin-wayland folder is a symlink, remove it."
rm "$KWIN_DIR-wayland"
fi
BRANDING_DIR="$HOME/.config/kdedefaults"
if [ ! -z "$(grep -rni "aerothemeplasma" "$BRANDING_DIR/kcm-about-distrorc")" ]; then
echo "Uninstalling branding..."
rm "$BRANDING_DIR/kcm-about-distrorc"
rm "$BRANDING_DIR/kcminfo.png"
fi
CURSOR_DIR="/usr/share/icons/aero-drop"
uninstall_prompt "Cursor theme (requires admin privileges)" "$CURSOR_DIR"
if [ "$?" == 1 ]; then
echo "Uninstalling cursor theme..."
pkexec rm -r "$CURSOR_DIR"
echo "Done."
fi
SDDM_DIR="/usr/share/sddm/themes/sddm-theme-mod"
uninstall_prompt "SDDM theme (requires admin privileges)" "$SDDM_DIR"
if [ "$?" == 1 ]; then
echo "Uninstalling SDDM theme..."
pkexec rm -r "$SDDM_DIR"
echo "Done."
fi
SMOD_DIR="/usr/share/smod"
uninstall_prompt "SMOD files (requires admin privileges)" "$SMOD_DIR"
if [ "$?" == 1 ]; then
echo "Uninstalling SMOD files..."
pkexec rm -r "$SMOD_DIR"
echo "Done."
fi
LIBDIR="/usr/lib/x86_64-linux-gnu/"
if [ ! -d ${LIBDIR} ]; then
LIBDIR="/usr/lib64/"
fi
APPLET_DIR="${LIBDIR}qt6/plugins/plasma/applets/"
uninstall_prompt "Plasma applets (requires admin privileges)" "${APPLET_DIR}/io.gitgud.wackyideas."*
if [ "$?" == 1 ]; then
echo "Uninstalling Plasma applet plugins..."
pkexec rm -r "${APPLET_DIR}/io.gitgud.wackyideas."*
echo "Done."
fi
echo "Uninstalling /opt/aerothemeplasma..."
pkexec rm -r "/opt/aerothemeplasma"
echo "Done."
echo -e "Uninstallation complete."
echo -e "In order to uninstall the libplasma and polkit agent modifications, simply reinstall those packages using your distro's package manager."