install.sh
Bourne-Again shell script, ASCII text executable
1
#!/bin/bash
2
3
repodir=$(cd $(dirname $0) && pwd)
4
srcdir=${repodir}/src
5
6
if type gnome-shell > /dev/null ; then
7
gnomever=$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f -2)
8
else
9
gnomever=3.18
10
fi
11
12
echo
13
14
# Not enabled color: '-dark'
15
for color in '' '-light' ; do
16
for size in '' '-compact' ; do
17
echo Installing Flat-Plat${color}${size} ...
18
19
themedir=${destdir}/usr/share/themes/Flat-Plat${color}${size}
20
install -d ${themedir}
21
22
# Copy COPYING
23
cd ${repodir}
24
cp -ur \
25
COPYING \
26
${themedir}
27
28
# Install index.theme
29
cd ${srcdir}
30
cp -ur \
31
index${color}${size}.theme \
32
${themedir}/index.theme
33
34
# Install Chrome Theme/Extention
35
install -d ${themedir}/chrome
36
cd ${srcdir}/chrome
37
cp -ur \
38
"Flat-Plat Scrollbars.crx" \
39
"Flat-Plat${color} Theme.crx" \
40
${themedir}/chrome
41
42
# Install GNOME Shell Theme
43
install -d ${themedir}/gnome-shell
44
cd ${srcdir}/gnome-shell/${gnomever}
45
cp -ur \
46
extensions \
47
no-events.svg \
48
no-notifications.svg \
49
process-working.svg \
50
${themedir}/gnome-shell
51
if [ "$color" != '-dark' ] ; then
52
cp -ur \
53
assets \
54
${themedir}/gnome-shell
55
else
56
cp -ur \
57
assets${color} \
58
${themedir}/gnome-shell/assets
59
fi
60
cp -ur \
61
gnome-shell${color}${size}.css \
62
${themedir}/gnome-shell/gnome-shell.css
63
glib-compile-resources \
64
--sourcedir=${themedir}/gnome-shell \
65
--target=${themedir}/gnome-shell/gnome-shell-theme.gresource \
66
gnome-shell-theme.gresource.xml
67
68
# Install GTK+ 2 Theme
69
install -d ${themedir}/gtk-2.0
70
cd ${srcdir}/gtk-2.0
71
cp -ur \
72
apps.rc \
73
main.rc \
74
${themedir}/gtk-2.0
75
if [ "$color" != '-dark' ] ; then
76
cp -ur \
77
assets \
78
${themedir}/gtk-2.0
79
else
80
cp -ur \
81
assets${color} \
82
${themedir}/gtk-2.0/assets
83
fi
84
cp -ur \
85
gtkrc${color} \
86
${themedir}/gtk-2.0/gtkrc
87
88
# Install GTK+ 3 Theme
89
install -d ${themedir}/gtk-common
90
cd ${srcdir}/gtk-3.0/gtk-common
91
cp -ur \
92
assets \
93
${themedir}/gtk-common
94
95
for version in '3.18' '3.20' '3.22' ; do
96
if [ "$version" == '3.18' ] ; then
97
install -d ${themedir}/gtk-3.0
98
cd ${srcdir}/gtk-3.0/${version}
99
cp -ur \
100
assets \
101
${themedir}/gtk-3.0
102
cp -ur \
103
gtk${color}.css \
104
${themedir}/gtk-3.0/gtk.css
105
if [ "$color" != '-dark' ] ; then
106
cp -ur \
107
gtk-dark.css \
108
${themedir}/gtk-3.0
109
fi
110
else
111
install -d ${themedir}/gtk-${version}
112
cd ${srcdir}/gtk-3.0/${version}
113
cp -ur \
114
assets \
115
${themedir}/gtk-${version}
116
cp -ur \
117
gtk${color}${size}.css \
118
${themedir}/gtk-${version}/gtk.css
119
if [ "$color" != '-dark' ] ; then
120
cp -ur \
121
gtk-dark${size}.css \
122
${themedir}/gtk-${version}/gtk-dark.css
123
fi
124
fi
125
done
126
127
# Install Metacity Theme
128
install -d ${themedir}/metacity-1
129
cd ${srcdir}/metacity-1
130
cp -ur \
131
*.svg \
132
${themedir}/metacity-1
133
if [ "$color" != '-light' ] ; then
134
cp -ur \
135
metacity-theme-2.xml \
136
metacity-theme-3.xml \
137
${themedir}/metacity-1
138
else
139
cp -ur \
140
metacity-theme-2${color}.xml \
141
${themedir}/metacity-1/metacity-theme-2.xml
142
cp -ur \
143
metacity-theme-3${color}.xml \
144
${themedir}/metacity-1/metacity-theme-3.xml
145
fi
146
147
# Install Unity Theme
148
install -d ${themedir}/unity
149
cd ${srcdir}/unity
150
cp -ur \
151
*.svg \
152
*.png \
153
*.json \
154
${themedir}/unity
155
if [ "$color" != '-light' ] ; then
156
cp -ur \
157
buttons \
158
${themedir}/unity
159
else
160
cp -urT \
161
buttons${color} \
162
${themedir}/unity/buttons
163
fi
164
done
165
done
166
167
echo
168
echo Done.
169