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 -p 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
pad-osd.css \
50
process-working.svg \
51
${themedir}/gnome-shell
52
if [ "$color" != '-dark' ] ; then
53
cp -ur \
54
assets \
55
${themedir}/gnome-shell
56
else
57
cp -ur \
58
assets${color} \
59
${themedir}/gnome-shell/assets
60
fi
61
cp -ur \
62
gnome-shell${color}${size}.css \
63
${themedir}/gnome-shell/gnome-shell.css
64
glib-compile-resources \
65
--sourcedir=${themedir}/gnome-shell \
66
--target=${themedir}/gnome-shell/gnome-shell-theme.gresource \
67
gnome-shell-theme.gresource.xml
68
69
# Install GTK+ 2 Theme
70
install -d ${themedir}/gtk-2.0
71
cd ${srcdir}/gtk-2.0
72
cp -ur \
73
apps.rc \
74
hacks.rc \
75
main.rc \
76
${themedir}/gtk-2.0
77
if [ "$color" != '-dark' ] ; then
78
cp -ur \
79
assets \
80
${themedir}/gtk-2.0
81
else
82
cp -ur \
83
assets${color} \
84
${themedir}/gtk-2.0/assets
85
fi
86
cp -ur \
87
gtkrc${color} \
88
${themedir}/gtk-2.0/gtkrc
89
90
# Install GTK+ 3 Theme
91
install -d ${themedir}/gtk-common
92
cd ${srcdir}/gtk-3.0/gtk-common
93
cp -ur \
94
assets \
95
${themedir}/gtk-common
96
97
for version in '3.18' '3.20' '3.22' ; do
98
if [ "$version" == '3.18' ] ; then
99
install -d ${themedir}/gtk-3.0
100
cd ${srcdir}/gtk-3.0/${version}
101
cp -ur \
102
assets \
103
${themedir}/gtk-3.0
104
cp -ur \
105
gtk${color}.css \
106
${themedir}/gtk-3.0/gtk.css
107
if [ "$color" != '-dark' ] ; then
108
cp -ur \
109
gtk-dark.css \
110
${themedir}/gtk-3.0
111
fi
112
else
113
install -d ${themedir}/gtk-${version}
114
cd ${srcdir}/gtk-3.0/${version}
115
cp -ur \
116
assets \
117
${themedir}/gtk-${version}
118
cp -ur \
119
gtk${color}${size}.css \
120
${themedir}/gtk-${version}/gtk.css
121
if [ "$color" != '-dark' ] ; then
122
cp -ur \
123
gtk-dark${size}.css \
124
${themedir}/gtk-${version}/gtk-dark.css
125
fi
126
fi
127
done
128
129
# Install Metacity Theme
130
install -d ${themedir}/metacity-1
131
cd ${srcdir}/metacity-1
132
cp -ur \
133
*.svg \
134
${themedir}/metacity-1
135
if [ "$color" != '-light' ] ; then
136
cp -ur \
137
metacity-theme-2.xml \
138
metacity-theme-3.xml \
139
${themedir}/metacity-1
140
else
141
cp -ur \
142
metacity-theme-2${color}.xml \
143
${themedir}/metacity-1/metacity-theme-2.xml
144
cp -ur \
145
metacity-theme-3${color}.xml \
146
${themedir}/metacity-1/metacity-theme-3.xml
147
fi
148
149
# Install Unity Theme
150
install -d ${themedir}/unity
151
cd ${srcdir}/unity
152
cp -ur \
153
*.svg \
154
*.png \
155
*.json \
156
${themedir}/unity
157
if [ "$color" != '-light' ] ; then
158
cp -ur \
159
buttons \
160
${themedir}/unity
161
else
162
cp -urT \
163
buttons${color} \
164
${themedir}/unity/buttons
165
fi
166
done
167
done
168
169
echo
170
echo Done.
171