forked from paulmcauley/klassy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.sh
executable file
·61 lines (54 loc) · 1.58 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
#!/bin/sh
# Modified from https://github.com/kupiqu/SierraBreezeEnhanced
ORIGINAL_DIR=$(pwd)
confirm() {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case "$response" in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
uninstall() {
sudo make uninstall && echo "Uninstalled successfully!"
}
cleanup() {
cd $ORIGINAL_DIR
sudo rm -rf build
}
# Recreate install manifest and uninstall
install_and_uninstall() {
sh install.sh &&
cd build &&
uninstall
echo It is possible that some files left over at the following locations
echo Please remove any files containing klassy in their name
echo - /usr/lib64/qt5/plugins/org.kde.kdecoration3/
echo - /usr/share/kservices5/
echo - /usr/lib64/
echo - /usr/share/kstyle/themes/
echo - /usr/lib64/qt5/plugins/styles/
echo - /usr/bin/
echo - /usr/share/icons/hicolor/scalable/apps/
echo - /usr/lib64/cmake/
}
if [ ! -d "build" ]; then
# If no build folder is found
confirm "No installation found, (re)install and uninstall? [y/n]" && install_and_uninstall
else
if test -f "$ORIGINAL_DIR/build/install_manifest.txt"; then
# Remove normally
echo Found $ORIGINAL_DIR/build/install_manifest.txt
cd build &&
uninstall &&
cleanup
else
# If no install manifest found
echo Did not find $ORIGINAL_DIR/build/install_manifest.txt
confirm "(re)install and uninstall? [y/n]" && install_and_uninstall && cleanup
fi
fi