A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 install.sh

View raw Download
text/x-shellscript • 5.48 kiB
Bourne-Again shell script, ASCII text executable
        
            
1
#!/bin/bash
2
set -ueo pipefail
3
#set -x
4
5
repodir=$(cd $(dirname $0) && pwd)
6
srcdir=${repodir}/src
7
8
9
if [[ $(which gnome-shell 2> /dev/null) ]] ; then
10
gnomever_major=$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f 1)
11
gnomever_minor=$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f 2)
12
13
if [ -e ${srcdir}/gnome-shell/$gnomever_major.$gnomever_minor ]; then
14
gnomever=$gnomever_major.$gnomever_minor
15
elif [ -e ${srcdir}/gnome-shell/$gnomever_major.$(($gnomever_minor + 1)) ]; then
16
gnomever=$gnomever_major.$(($gnomever_minor + 1))
17
elif [ -e ${srcdir}/gnome-shell/$gnomever_major.$(($gnomever_minor - 1)) ]; then
18
gnomever=$gnomever_major.$(($gnomever_minor - 1))
19
else
20
gnomever=3.18
21
fi
22
else
23
gnomever=3.18
24
fi
25
26
echo
27
28
themedir_base_fallback=${destdir:-}/usr/share/themes/Flat-Plat
29
themedir_base=${THEME_DIR_BASE:-$themedir_base_fallback}
30
31
_COLOR_VARIANTS=(
32
''
33
'-dark'
34
'-light'
35
)
36
if [ ! -z "${COLOR_VARIANTS:-}" ] ; then
37
IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"
38
fi
39
_SIZE_VARIANTS=(
40
''
41
'-compact'
42
)
43
if [ ! -z "${SIZE_VARIANTS:-}" ] ; then
44
IFS=', ' read -r -a _SIZE_VARIANTS <<< "${SIZE_VARIANTS:-}"
45
fi
46
47
for color in "${_COLOR_VARIANTS[@]}" ; do
48
for size in "${_SIZE_VARIANTS[@]}" ; do
49
echo Installing Flat-Plat${color}${size} ...
50
51
themedir=${themedir_base}${color}${size}
52
if [[ -d ${themedir} ]] ; then
53
rm -r ${themedir}
54
fi
55
install -d ${themedir}
56
57
# Copy COPYING
58
cd ${repodir}
59
cp -ur \
60
COPYING \
61
${themedir}
62
63
# Install index.theme
64
cd ${srcdir}
65
cp -ur \
66
index${color}${size}.theme \
67
${themedir}/index.theme
68
69
# Install Chrome Theme/Extention
70
install -d ${themedir}/chrome
71
cd ${srcdir}/chrome
72
cp -ur \
73
"Flat-Plat${color} Theme.crx" \
74
${themedir}/chrome
75
if [ "$color" != '-dark' ] ; then
76
cp -ur \
77
"Flat-Plat Scrollbars.crx" \
78
${themedir}/chrome
79
else
80
cp -ur \
81
"Flat-Plat${color} Scrollbars.crx" \
82
${themedir}/chrome
83
fi
84
85
# Install GNOME Shell Theme
86
install -d ${themedir}/gnome-shell
87
cd ${srcdir}/gnome-shell/${gnomever}
88
cp -ur \
89
*.svg \
90
${themedir}/gnome-shell
91
cp -urL \
92
extensions \
93
pad-osd.css \
94
${themedir}/gnome-shell
95
if [ "$color" != '-dark' ] ; then
96
cp -urL \
97
assets \
98
${themedir}/gnome-shell
99
else
100
cp -urL \
101
assets${color} \
102
${themedir}/gnome-shell/assets
103
fi
104
cp -ur \
105
gnome-shell${color}${size}.css \
106
${themedir}/gnome-shell/gnome-shell.css
107
glib-compile-resources \
108
--sourcedir=${themedir}/gnome-shell \
109
--target=${themedir}/gnome-shell/gnome-shell-theme.gresource \
110
gnome-shell-theme.gresource.xml
111
112
# Install GTK+ 2 Theme
113
install -d ${themedir}/gtk-2.0
114
cd ${srcdir}/gtk-2.0
115
cp -ur \
116
apps.rc \
117
hacks.rc \
118
main.rc \
119
${themedir}/gtk-2.0
120
if [ "$color" != '-dark' ] ; then
121
cp -ur \
122
assets \
123
${themedir}/gtk-2.0
124
else
125
cp -ur \
126
assets${color} \
127
${themedir}/gtk-2.0/assets
128
fi
129
cp -ur \
130
gtkrc${color} \
131
${themedir}/gtk-2.0/gtkrc
132
133
# Install GTK+ 3 Theme
134
install -d ${themedir}/gtk-common
135
cd ${srcdir}/gtk-3.0/gtk-common
136
cp -ur \
137
assets \
138
${themedir}/gtk-common
139
140
for version in '3.18' '3.20' '3.22' ; do
141
if [ "$version" == '3.18' ] ; then
142
install -d ${themedir}/gtk-3.0
143
cd ${srcdir}/gtk-3.0/${version}
144
cp -ur \
145
assets \
146
${themedir}/gtk-3.0
147
cp -ur \
148
gtk${color}.css \
149
${themedir}/gtk-3.0/gtk.css
150
if [ "$color" != '-dark' ] && [ -f gtk-dark.css ]; then
151
cp -ur \
152
gtk-dark.css \
153
${themedir}/gtk-3.0
154
fi
155
else
156
install -d ${themedir}/gtk-${version}
157
cd ${srcdir}/gtk-3.0/${version}
158
cp -ur \
159
assets \
160
${themedir}/gtk-${version}
161
cp -ur \
162
gtk${color}${size}.css \
163
${themedir}/gtk-${version}/gtk.css
164
if [ "$color" != '-dark' ] && [ -f gtk-dark.css ]; then
165
cp -ur \
166
gtk-dark${size}.css \
167
${themedir}/gtk-${version}/gtk-dark.css
168
fi
169
fi
170
done
171
172
# Install Metacity Theme
173
install -d ${themedir}/metacity-1
174
cd ${srcdir}/metacity-1
175
cp -ur \
176
*.svg \
177
${themedir}/metacity-1
178
if [ "$color" != '-light' ] ; then
179
cp -ur \
180
metacity-theme-2.xml \
181
metacity-theme-3.xml \
182
${themedir}/metacity-1
183
else
184
cp -ur \
185
metacity-theme-2${color}.xml \
186
${themedir}/metacity-1/metacity-theme-2.xml
187
cp -ur \
188
metacity-theme-3${color}.xml \
189
${themedir}/metacity-1/metacity-theme-3.xml
190
fi
191
192
# Install Unity Theme
193
install -d ${themedir}/unity
194
cd ${srcdir}/unity
195
cp -ur \
196
*.svg \
197
*.png \
198
*.json \
199
${themedir}/unity
200
if [ "$color" != '-light' ] ; then
201
cp -ur \
202
buttons \
203
${themedir}/unity
204
else
205
cp -urT \
206
buttons${color} \
207
${themedir}/unity/buttons
208
fi
209
210
# Install Xfwm Theme
211
install -d ${themedir}/xfwm4
212
cd ${srcdir}/xfwm4
213
cp -ur \
214
*.svg \
215
themerc \
216
${themedir}/xfwm4
217
if [ "$color" != '-light' ] ; then
218
cp -ur \
219
assets \
220
${themedir}/xfwm4
221
else
222
cp -urT \
223
assets${color} \
224
${themedir}/xfwm4/assets
225
fi
226
done
227
done
228
229
echo
230
echo Done.
231
232
# vim: set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab:
233