generated from batden/extinguish
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheloge.sh
338 lines (295 loc) · 7.87 KB
/
eloge.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
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
#!/bin/bash
# shellcheck disable=SC1091 disable=SC2164
# This script helps you cleanly and safely uninstall Enlightenment and related applications.
# Note that the binary dependencies (dev packages) are kept for system consistency.
# There is no safe way to remove them automatically, without close supervision
# by the user.
# ELOGE.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/
# Got a GitHub account?
# If you find this script useful, please consider starring our repositories to show your support.
# Thank you!
RED_BRIGHT="\e[1;38;5;1m"
ITALIC="\e[3m"
OFF="\e[0m"
SCRFLDR=$HOME/.elucidate
DDCTL=2.0.0
PROG_MBS="
terminology
enlightenment
ephoto
rage
evisum
express
ecrire
enventor
edi
entice
enlightenment-module-forecasts
enlightenment-module-penguins
enlightenment-module-places
eflete
efl"
beep_exit() {
aplay --quiet /usr/share/sounds/sound-icons/pipe.wav
}
# Remove prerequisites.
remov_preq() {
echo
if [ -d "$ESRCDIR"/rlottie ]; then
read -r -t 12 -p "Remove rlottie? [Y/n] " answer
case $answer in
y | Y)
cd "$ESRCDIR"/rlottie || exit
sudo ninja -C build uninstall
cd .. && rm -rf rlottie
sudo rm -rf /usr/local/lib/x86_64-linux-gnu/pkgconfig/rlottie.pc
echo
;;
n | N)
printf "\n$ITALIC%s $OFF%s\n\n" "(do not remove rlottie... OK)"
;;
*)
cd "$ESRCDIR"/rlottie
echo
sudo ninja -C build uninstall
cd .. && rm -rf rlottie
sudo rm -rf /usr/local/lib/x86_64-linux-gnu/pkgconfig/rlottie.pc
echo
;;
esac
fi
if [ -d "$ESRCDIR"/ddcutil-$DDCTL ]; then
read -r -t 12 -p "Remove ddcutil? [Y/n] " answer
case $answer in
y | Y)
cd "$ESRCDIR"/ddcutil-$DDCTL
sudo make uninstall
cd .. && rm -rf "$ESRCDIR"/ddcutil-$DDCTL
rm -rf "$HOME"/.cache/ddcutil
sudo rm -rf /usr/local/lib/cmake/ddcutil
sudo rm -rf /usr/local/share/ddcutil
echo
;;
n | N)
printf "\n$ITALIC%s $OFF%s\n\n" "(do not remove ddcutil... OK)"
;;
*)
cd "$ESRCDIR"/ddcutil-$DDCTL
echo
sudo make uninstall
cd .. && rm -rf "$ESRCDIR"/ddcutil-$DDCTL
rm -rf "$HOME"/.cache/ddcutil
sudo rm -rf /usr/local/lib/cmake/ddcutil
sudo rm -rf /usr/local/share/ddcutil
echo
;;
esac
fi
}
# Clean any leftover files after uninstalling Enlightenment and related applications.
del_list() {
cd /etc
sudo rm -rf enlightenment
cd /etc/xdg/menus
sudo rm -rf e-applications.menu
cd /usr/local/bin
sudo rm -rf efl*
cd /usr/local/etc
sudo rm -rf enlightenment
cd /usr/local/include
sudo rm -rf -- *-1
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 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 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*
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
sudo sed -i '/ecrire/d' mimeinfo.cache
sudo sed -i '/entice/d' mimeinfo.cache
sudo sed -i '/ephoto/d' mimeinfo.cache
sudo sed -i '/rage/d' mimeinfo.cache
sudo rm -rf enlightenment_paledit.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"
sudo rm -rf "$ESRCDIR"/enlighten
rm -rf "$SCRFLDR"
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/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/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/elucidate.sh
}
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 the translation files too.
find /usr/local/share/locale/*/LC_MESSAGES | while read -r I; do
echo "$I" |
xargs sudo rm -rf \
"$(grep -E 'efl|enlightenment|ephoto|evisum|terminology|ecrire|edi|enventor|eflete|forecasts|penguins|places')"
done
}
uninstall_enlighten() {
if [ "$XDG_CURRENT_DESKTOP" == "Enlightenment" ]; then
printf "$RED_BRIGHT%s $OFF%s\n\n" "PLEASE LOG IN TO THE DEFAULT DESKTOP ENVIRONMENT TO EXECUTE 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
ESRCDIR=$(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_MBS; do
cd "$ESRCDIR/enlighten/$I"
sudo ninja -C build uninstall
echo
done
remov_preq
del_list
final_stp
}
# Call the main function.
lo() {
trap '{ printf "\n$RED_BRIGHT%s $OFF%s\n\n" "KEYBOARD INTERRUPT."; exit 130; }' INT
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 "eloge" and "ebackups" in your home folder.'
}
lo