-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextinguish.sh
More file actions
363 lines (320 loc) · 8.71 KB
/
Copy pathextinguish.sh
File metadata and controls
363 lines (320 loc) · 8.71 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
#!/bin/bash
# shellcheck disable=SC1091 disable=SC2164
# This script will help you uninstall Enlightenment and related applications cleanly and safely.
# Note that the binary dependencies (dev packages) are preserved for system consistency.
# There is no safe way to remove them automatically, without close supervision by the user.
# EXTINGUISH.SH is licensed under a Creative Commons Attribution 4.0 International License,
# in memory of Aaron Swartz.
# See https://creativecommons.org/licenses/by/4.0/
# If you find our scripts useful, please consider starring our repositories to show your support.
# Thank you!
# --- Color and formatting variables ---
red_bright="\e[1;38;5;1m"
italic="\e[3m"
off="\e[0m"
# --- Paths ---
scrfldr=$HOME/.elluminate
ddctl=2.2.7
# --- Enlightenment programs to be removed ---
prog_rm=(
eflete
enlightenment-module-places
enlightenment-module-penguins
enlightenment-module-forecasts
entice
edi
enventor
ecrire
express
evisum
rage
ephoto
enlightenment
terminology
efl
)
# --- Play exit sound ---
beep_exit() {
aplay --quiet /usr/share/sounds/sound-icons/pipe.wav
}
# --- Remove prerequisites ---
remov_preq() {
echo
if [ -d "$esrc/rlottie" ]; then
read -r -t 12 -p "Remove rlottie? [Y/n] " answer
case $answer in
y | Y)
cd "$esrc/rlottie"
sudo ninja -C build uninstall
cd .. && rm -rf rlottie
sudo rm -rf /usr/local/lib/x86_64-linux-gnu/pkgconfig/rlottie.pc
;;
n | N)
printf "\n$italic%s $off%s\n\n" "(do not remove rlottie... OK)"
;;
*)
cd "$esrc/rlottie"
sudo ninja -C build uninstall
cd .. && rm -rf rlottie
sudo rm -rf /usr/local/lib/x86_64-linux-gnu/pkgconfig/rlottie.pc
;;
esac
echo
fi
ddctl_ver=("$ddctl" "2.2.6" "2.2.7")
for i in "${ddctl_ver[@]}"; do
if [ -d "$esrc/ddcutil-$i" ]; then
read -r -t 12 -p "Remove ddcutil-$i? [Y/n] " answer
case $answer in
y | Y)
cd "$esrc/ddcutil-$i"
sudo make uninstall
cd .. && rm -rf "$esrc/ddcutil-$i"
rm -rf "$HOME/.cache/ddcutil"
sudo rm -rf /usr/local/lib/cmake/ddcutil
sudo rm -rf /usr/local/share/ddcutil
;;
n | N)
printf "\n$italic%s $off%s\n\n" "(do not remove ddcutil-$i... OK)"
;;
*)
cd "$esrc/ddcutil-$i"
sudo make uninstall
cd .. && rm -rf "$esrc/ddcutil-$i"
rm -rf "$HOME/.cache/ddcutil"
sudo rm -rf /usr/local/lib/cmake/ddcutil
sudo rm -rf /usr/local/share/ddcutil
;;
esac
echo
fi
done
}
# --- Clean up leftover files after uninstall ---
del_list() {
# Remove system-wide files and directories.
cd /etc
sudo rm -rf enlightenment
cd /etc/xdg/menus
sudo rm -rf e-applications.menu
cd /usr/local/bin
sudo rm -rf efl*
sudo rm -rf elua*
sudo rm -rf entice*
cd /usr/local/etc
sudo rm -rf enlightenment
cd /usr/local/include
sudo rm -rf -- *-1
sudo rm -rf enigmatic
sudo rm -rf enlightenment
sudo rm -rf express-0
cd /usr/local/lib/x86_64-linux-gnu
sudo rm -rf ecore*
sudo rm -rf edje*
sudo rm -rf eeze*
sudo rm -rf efreet*
sudo rm -rf elementary*
sudo rm -rf emotion*
sudo rm -rf enlightenment*
sudo rm -rf ephoto*
sudo rm -rf ethumb*
sudo rm -rf evas*
sudo rm -rf rage*
sudo rm -rf libecore*
sudo rm -rf libector*
sudo rm -rf libedi*
sudo rm -rf libedje*
sudo rm -rf libeet*
sudo rm -rf libeeze*
sudo rm -rf libefl*
sudo rm -rf libefreet*
sudo rm -rf libeina*
sudo rm -rf libeio*
sudo rm -rf libeldbus*
sudo rm -rf libelementary*
sudo rm -rf libelput*
sudo rm -rf libelua*
sudo rm -rf libembryo*
sudo rm -rf libemile*
sudo rm -rf libemotion*
sudo rm -rf libenigmatic*
sudo rm -rf libeo*
sudo rm -rf libeolian*
sudo rm -rf libethumb*
sudo rm -rf libevas*
sudo rm -rf libexactness*
cd /usr/local/lib/x86_64-linux-gnu/cmake
sudo rm -rf Ecore*
sudo rm -rf Edje*
sudo rm -rf Eet*
sudo rm -rf Eeze*
sudo rm -rf Efl*
sudo rm -rf Efreet
sudo rm -rf Eina*
sudo rm -rf Eio*
sudo rm -rf Eldbus*
sudo rm -rf Elementary*
sudo rm -rf Elua*
sudo rm -rf Emile*
sudo rm -rf Emotion*
sudo rm -rf Eo*
sudo rm -rf Eolian*
sudo rm -rf Ethumb*
sudo rm -rf Evas*
cd /usr/local/lib/x86_64-linux-gnu/pkgconfig
sudo rm -rf ecore*
sudo rm -rf efl*
sudo rm -rf elua*
cd /usr/local/share
sudo rm -rf ecore*
sudo rm -rf ecrire*
sudo rm -rf edi*
sudo rm -rf edje*
sudo rm -rf eeze*
sudo rm -rf eflete*
sudo rm -rf efreet*
sudo rm -rf elementary*
sudo rm -rf elua*
sudo rm -rf embryo*
sudo rm -rf emotion*
sudo rm -rf enlightenment*
sudo rm -rf entice*
sudo rm -rf enventor*
sudo rm -rf evisum*
sudo rm -rf eo*
sudo rm -rf eolian*
sudo rm -rf ephoto*
sudo rm -rf ethumb*
sudo rm -rf evas*
sudo rm -rf exactness*
sudo rm -rf express*
sudo rm -rf rage*
sudo rm -rf terminology*
sudo rm -rf wayland-sessions*
cd /usr/local/share/applications
sudo sed -i '/enlightenment_filemanager/d' mimeinfo.cache &>/dev/null
sudo sed -i '/ecrire/d' mimeinfo.cache &>/dev/null
sudo sed -i '/entice/d' mimeinfo.cache &>/dev/null
sudo sed -i '/ephoto/d' mimeinfo.cache &>/dev/null
sudo sed -i '/rage/d' mimeinfo.cache &>/dev/null
sudo rm -rf enlightenment_paledit.desktop
sudo rm -rf evisum_cpu.desktop
sudo rm -rf evisum_mem.desktop
sudo rm -rf terminology.desktop
cd /usr/local/share/doc
sudo rm -rf edi
cd /usr/local/share/gdb/auto-load/usr/lib
sudo rm -rf libeo*
cd /usr/local/share/icons
sudo rm -rf Enlightenment*
cd /usr/local/share/info
sudo rm -rf edi
cd /usr/share/dbus-1/services
sudo rm -rf org.enlightenment.Ethumb.service
cd /usr/share/wayland-sessions
sudo rm -rf enlightenment.desktop
cd /usr/share/xsessions
sudo rm -rf enlightenment.desktop
cd "$HOME"
# Remove user files and directories.
rm -rf .e
rm -rf .e-log*
rm -rf .elementary
sudo chattr -i "$HOME"/.cache/ebuilds/storepath && rm -rf .cache/ebuilds
rm -rf .cache/efreet
rm -rf .cache/enigmatic
rm -rf .cache/entice
rm -rf .cache/ephoto
rm -rf .cache/evas_gl_common_caches
rm -rf .cache/rage
rm -rf .config/ecrire.cfg
rm -rf .config/edi
rm -rf .config/eflete
rm -rf .config/enigmatic
rm -rf .config/entice
rm -rf .config/enventor
rm -rf .config/ephoto
rm -rf .config/evisum
rm -rf .config/express
rm -rf .config/rage
rm -rf .config/terminology
rm -rf .local/bin/elluminate.sh
rm -rf "$scrfldr"
sudo rm -rf "$esrc"/enlighten
}
# --- Final cleanup steps ---
final_stp() {
if [ -f "$HOME/.bash_aliases" ]; then
read -r -t 12 -p "Remove the .bash_aliases file? [Y/n] " answer
case $answer in
y | Y)
rm -rf "$HOME/.bash_aliases" && source "$HOME/.bashrc"
sleep 1
;;
n | N)
printf "\n$italic%s $off%s\n\n" "(do not delete .bash_aliases... OK)"
sleep 1
;;
*)
echo
rm -rf "$HOME"/.bash_aliases && source "$HOME"/.bashrc
sleep 1
;;
esac
fi
sudo rm -rf /usr/lib/systemd/user/enlightenment.service
sudo rm -rf /usr/lib/systemd/user/ethumb.service
sudo rm -rf /usr/lib/libintl.so
sudo systemctl daemon-reload
sudo ldconfig
# Remove translation files.
if [ -d /usr/local/share/locale ]; then
find /usr/local/share/locale -name "LC_MESSAGES" -type d 2>/dev/null |
while read -r i; do
find "$i" -name "*.mo" |
grep -E -e 'efl|enlightenment|ephoto|evisum|terminology|ecrire|edi|enventor|eflete' \
-e 'forecasts|e-module-penguins|e-module-places' |
while read -r mo_file; do
sudo rm -f "$mo_file"
done
done
fi
}
# --- Uninstall Enlightenment ecosystem ---
uninstall_enlighten() {
if [ "$XDG_CURRENT_DESKTOP" == "Enlightenment" ]; then
printf "$red_bright%s $off%s\n\n" "PLEASE LOG IN TO THE DEFAULT DESKTOP TO RUN THIS SCRIPT."
beep_exit
exit 1
fi
if [ -x /usr/bin/wmctrl ]; then
if [ "$XDG_SESSION_TYPE" == "x11" ]; then
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
fi
fi
esrc=$(cat "$HOME"/.cache/ebuilds/storepath)
clear
printf "\n\n$red_bright%s %s\n\n" "* UNINSTALLING ENLIGHTENMENT DESKTOP ENVIRONMENT *"
sleep 1
printf "$red_bright%s $off%s\n\n" "You will be prompted to answer some basic questions..."
sleep 2
cd "$HOME"
for i in "${prog_rm[@]}"; do
printf "$red_bright%s %s$off\n" "Uninstalling" "$i..."
cd "$esrc/enlighten/$i"
sudo ninja -C build uninstall
printf "\n"
done
remov_preq
del_list
final_stp
}
# --- Main entry point ---
main() {
trap '{ printf "\n$red_bright%s $off%s\n\n" "KEYBOARD INTERRUPT."; exit 130; }' SIGINT
uninstall_enlighten
printf "\n\n$red_bright%s %s\n" "Done."
printf "$red_bright%s $off%s\n\n" \
'Candidates for further deletion: Search for "extinguish" and "ebackups" in your home folder.'
}
main "$@"