forked from KDE-Styles/adapta-kde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·102 lines (81 loc) · 2.49 KB
/
install.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
#!/bin/sh
set -e
gh_repo="adapta-kde"
gh_desc="Adapta KDE"
cat <<- EOF
aaa dd tt
aa aa ddddd aaaaa ppppp ttttttt aaaaa
aaaaaaa dd dd aa aa pp pp tt aa aa
aa aa dd dd aa aa pp pp tt aa aa
aa aa ddddd aaaaa ppppp ttt aaaaa
pp
kk kk ddddd eeeeeee pp
kk kk dd dd ee
kkk dd dd eeeee
kk kk dd dd ee
kk kk ddddd eeeeeee
$gh_desc
https://github.com/PapirusDevelopmentTeam/$gh_repo
EOF
: "${PREFIX:=/usr}"
: "${TAG:=master}"
: "${uninstall:=false}"
_msg() {
echo "=>" "$@" >&2
}
_rm() {
# removes parent directories if empty
sudo rm -rf "$1"
sudo rmdir -p "$(dirname "$1")" 2>/dev/null || true
}
_download() {
_msg "Getting the latest version from GitHub ..."
wget -O "$temp_file" \
"https://github.com/PapirusDevelopmentTeam/$gh_repo/archive/$TAG.tar.gz"
_msg "Unpacking archive ..."
tar -xzf "$temp_file" -C "$temp_dir"
}
_uninstall() {
_msg "Deleting $gh_desc ..."
_rm "$PREFIX/share/aurorae/themes/Adapta"
_rm "$PREFIX/share/color-schemes/Adapta.colors"
_rm "$PREFIX/share/color-schemes/AdaptaNokto.colors"
_rm "$PREFIX/share/konsole/Adapta.colorscheme"
_rm "$PREFIX/share/konsole/AdaptaNokto.colorscheme"
_rm "$PREFIX/share/Kvantum/Adapta"
_rm "$PREFIX/share/Kvantum/AdaptaNokto"
_rm "$PREFIX/share/plasma/desktoptheme/Adapta"
_rm "$PREFIX/share/plasma/look-and-feel/com.github.varlesh.adapta"
_rm "$PREFIX/share/wallpapers/Adapta"
_rm "$PREFIX/share/yakuake/skins/adapta"
_rm "$PREFIX/share/yakuake/skins/adapta-nokto"
}
_install() {
_msg "Installing ..."
sudo cp -R \
"$temp_dir/$gh_repo-$TAG/aurorae" \
"$temp_dir/$gh_repo-$TAG/color-schemes" \
"$temp_dir/$gh_repo-$TAG/konsole" \
"$temp_dir/$gh_repo-$TAG/Kvantum" \
"$temp_dir/$gh_repo-$TAG/plasma" \
"$temp_dir/$gh_repo-$TAG/wallpapers" \
"$temp_dir/$gh_repo-$TAG/yakuake" \
"$PREFIX/share"
}
_cleanup() {
_msg "Clearing cache ..."
rm -rf "$temp_file" "$temp_dir" \
~/.cache/plasma-svgelements-Adapta* \
~/.cache/plasma_theme_Adapta*.kcache
_msg "Done!"
}
trap _cleanup EXIT HUP INT TERM
temp_file="$(mktemp -u)"
temp_dir="$(mktemp -d)"
if [ "$uninstall" = "false" ]; then
_download
_uninstall
_install
else
_uninstall
fi