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
themedir_base_fallback=${destdir:-}/usr/share/themes/Materia
9
themedir_base=${THEME_DIR_BASE:-$themedir_base_fallback}
10
11
if [[ $(which gnome-shell 2> /dev/null) ]]; then
12
gnomever_major=$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f 1)
13
gnomever_minor=$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f 2)
14
15
if [ -e ${srcdir}/gnome-shell/$gnomever_major.$gnomever_minor ]; then
16
gnomever=$gnomever_major.$gnomever_minor
17
elif [ -e ${srcdir}/gnome-shell/$gnomever_major.$(($gnomever_minor + 1)) ]; then
18
gnomever=$gnomever_major.$(($gnomever_minor + 1))
19
elif [ -e ${srcdir}/gnome-shell/$gnomever_major.$(($gnomever_minor - 1)) ]; then
20
gnomever=$gnomever_major.$(($gnomever_minor - 1))
21
else
22
gnomever=3.18
23
fi
24
else
25
gnomever=3.18
26
fi
27
28
_COLOR_VARIANTS=(
29
''
30
'-dark'
31
'-light'
32
)
33
if [ ! -z "${COLOR_VARIANTS:-}" ]; then
34
IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"
35
fi
36
37
_SIZE_VARIANTS=(
38
''
39
'-compact'
40
)
41
if [ ! -z "${SIZE_VARIANTS:-}" ]; then
42
IFS=', ' read -r -a _SIZE_VARIANTS <<< "${SIZE_VARIANTS:-}"
43
fi
44
45
echo
46
47
for color in "${_COLOR_VARIANTS[@]}"; do
48
for size in "${_SIZE_VARIANTS[@]}"; do
49
echo Installing Materia${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
"Materia${color} Theme.crx" \
74
${themedir}/chrome
75
if [ "$color" != '-dark' ]; then
76
cp -ur \
77
"Materia Scrollbars.crx" \
78
${themedir}/chrome
79
else
80
cp -ur \
81
"Materia${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
noise-texture.png \
94
pad-osd.css \
95
${themedir}/gnome-shell
96
if [ "$color" != '-dark' ]; then
97
cp -urL \
98
assets \
99
${themedir}/gnome-shell
100
else
101
cp -urL \
102
assets${color} \
103
${themedir}/gnome-shell/assets
104
fi
105
cp -ur \
106
gnome-shell${color}${size}.css \
107
${themedir}/gnome-shell/gnome-shell.css
108
glib-compile-resources \
109
--sourcedir=${themedir}/gnome-shell \
110
--target=${themedir}/gnome-shell/gnome-shell-theme.gresource \
111
gnome-shell-theme.gresource.xml
112
113
# Install GTK+ 2 Theme
114
install -d ${themedir}/gtk-2.0
115
cd ${srcdir}/gtk-2.0
116
cp -ur \
117
apps.rc \
118
hacks.rc \
119
main.rc \
120
${themedir}/gtk-2.0
121
if [ "$color" != '-dark' ]; then
122
cp -ur \
123
assets \
124
${themedir}/gtk-2.0
125
else
126
cp -ur \
127
assets${color} \
128
${themedir}/gtk-2.0/assets
129
fi
130
cp -ur \
131
gtkrc${color} \
132
${themedir}/gtk-2.0/gtkrc
133
134
# Install GTK+ 3 Theme
135
install -d ${themedir}/gtk-common
136
cd ${srcdir}/gtk-3.0/gtk-common
137
cp -ur \
138
assets \
139
${themedir}/gtk-common
140
141
for version in '3.18' '3.20' '3.22'; do
142
if [ "$version" == '3.18' ]; then
143
install -d ${themedir}/gtk-3.0
144
cd ${srcdir}/gtk-3.0/${version}
145
cp -ur \
146
assets \
147
${themedir}/gtk-3.0
148
cp -ur \
149
gtk${color}.css \
150
${themedir}/gtk-3.0/gtk.css
151
if [ "$color" != '-dark' ] && [ -f gtk-dark.css ]; then
152
cp -ur \
153
gtk-dark.css \
154
${themedir}/gtk-3.0
155
fi
156
else
157
install -d ${themedir}/gtk-${version}
158
cd ${srcdir}/gtk-3.0/${version}
159
cp -ur \
160
assets \
161
${themedir}/gtk-${version}
162
cp -ur \
163
gtk${color}${size}.css \
164
${themedir}/gtk-${version}/gtk.css
165
if [ "$color" != '-dark' ] && [ -f gtk-dark.css ]; then
166
cp -ur \
167
gtk-dark${size}.css \
168
${themedir}/gtk-${version}/gtk-dark.css
169
fi
170
fi
171
done
172
173
# Install Metacity Theme
174
install -d ${themedir}/metacity-1
175
cd ${srcdir}/metacity-1
176
cp -ur \
177
assets \
178
${themedir}/metacity-1
179
if [ "$color" != '-light' ]; then
180
cp -ur \
181
metacity-theme-2.xml \
182
metacity-theme-3.xml \
183
${themedir}/metacity-1
184
else
185
cp -ur \
186
metacity-theme-2${color}.xml \
187
${themedir}/metacity-1/metacity-theme-2.xml
188
cp -ur \
189
metacity-theme-3${color}.xml \
190
${themedir}/metacity-1/metacity-theme-3.xml
191
fi
192
193
# Install Unity Theme
194
install -d ${themedir}/unity
195
cd ${srcdir}/unity
196
cp -ur \
197
*.svg \
198
*.png \
199
*.json \
200
${themedir}/unity
201
if [ "$color" != '-light' ]; then
202
cp -ur \
203
assets \
204
${themedir}/unity
205
else
206
cp -urT \
207
assets${color} \
208
${themedir}/unity/assets
209
fi
210
211
# Install Xfwm Theme
212
install -d ${themedir}/xfwm4
213
cd ${srcdir}/xfwm4
214
cp -ur \
215
*.svg \
216
themerc \
217
${themedir}/xfwm4
218
if [ "$color" != '-light' ]; then
219
cp -ur \
220
assets \
221
${themedir}/xfwm4
222
else
223
cp -urT \
224
assets${color} \
225
${themedir}/xfwm4/assets
226
fi
227
done
228
done
229
230
echo
231
echo Done.
232
233
# vim: set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab:
234