-
Notifications
You must be signed in to change notification settings - Fork 218
/
install.sh
executable file
·442 lines (420 loc) · 10.9 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
#! /usr/bin/env bash
REPO_DIR="$(dirname "$(readlink -m "${0}")")"
source "${REPO_DIR}/core.sh"
usage() {
cat << EOF
Usage: $0 [OPTION]...
OPTIONS:
-d, --dest DIR Specify destination directory (Default: $DEST_DIR)
-n, --name NAME Specify theme name (Default: $THEME_NAME)
-t, --theme VARIANT Specify theme color variant(s) [default|purple|pink|red|orange|yellow|green|teal|grey|all] (Default: blue)
-c, --color VARIANT Specify color variant(s) [standard|light|dark] (Default: All variants)s)
-s, --size VARIANT Specify size variant [standard|compact] (Default: All variants)
-i, --icon VARIANT Specify icon variant(s) for shell panel activities button
[default|apple|simple|gnome|ubuntu|arch|manjaro|fedora|debian|void|opensuse|popos|mxlinux|zorin|endeavouros|tux|nixos|gentoo|budgie]
(Default: ChromeOS style)
-l, --libadwaita Link installed Orchis gtk-4.0 theme to config folder for all libadwaita app use Orchis theme
--tweaks Specify versions for tweaks [solid|compact|black|primary|macos|submenu|(nord/dracula)] (Options can mix)
1. solid No transparency panel variant
2. compact No floating panel variant
3. black Full black variant
4. primary Change radio icon checked color to primary theme color (Default is Green)
5. macos Change window buttons to MacOS style
6. submenu Set normal submenus color contrast (dark submenu style on dark version)
7. [nord|dracula] Nord/dracula colorscheme themes (nord and dracula can not mix use!)
8. dock Fix style for 'dash-to-dock' or 'ubuntu-dock' extension
--round Change theme round corner border-radius [Input the px value you want] (Suggested: 2px < value < 16px)
1. 3px
2. 4px
3. 5px
...
13. 15px
--shell install gnome-shell version [38|40|42|44|46] (Without this option script will detect shell version and install the right theme)
1. 38 Gnome-shell version <= 38.0
2. 40 Gnome-shell version = 40.0
3. 42 Gnome-shell version = 42.0
4. 44 Gnome-shell version = 44.0
4. 46 Gnome-shell version = 46.0
-r, --remove,
-u, --uninstall Uninstall/Remove installed themes
-h, --help Show help
EOF
}
themes=()
colors=()
sizes=()
othemes=()
ocolors=()
osizes=()
lcolors=()
while [[ "$#" -gt 0 ]]; do
case "${1:-}" in
-d|--dest)
dest="$2"
mkdir -p "$dest"
shift 2
;;
-n|--name)
_name="$2"
shift 2
;;
-r|--remove|-u|--uninstall)
remove="true"
shift
;;
-l|--libadwaita)
libadwaita="true"
shift
;;
--round)
round="true"
corner="$2"
echo -e "Change round corner ${corner} value ..."
shift 2
;;
--shell)
shift
for shell in $@; do
case "$shell" in
38)
shell="38"
shift
;;
40)
shell="40"
shift
;;
42)
shell="42"
shift
;;
44)
shell="44"
shift
;;
46)
shell="46"
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized shell variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
;;
--tweaks)
shift
for variant in $@; do
case "$variant" in
solid)
opacity="solid"
echo -e "Install solid version ..."
shift
;;
compact)
panel="compact"
echo -e "Install compact panel version ..."
shift
;;
black)
blackness="true"
echo -e "Install black version ..."
shift
;;
primary)
primary="true"
echo "Change radio and check assets color ..."
shift
;;
macos)
macstyle="true"
echo -e "Install MacOS style window button version ..."
shift
;;
submenu)
submenu="true"
echo -e "Install with themed sub-menus ..."
shift
;;
nord)
nord="true"
ctype="-Nord"
echo -e "Install nord colorscheme ..."
shift
;;
dracula)
dracula="true"
ctype="-Dracula"
echo -e "Install dracula colorscheme ..."
shift
;;
dock)
dockfix="true"
echo -e "\nFix 'dash-to-dock' or 'ubuntu-dock' style ..."
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized tweaks variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
;;
-t|--theme)
accent='true'
shift
for variant in "$@"; do
case "$variant" in
default)
themes+=("${THEME_VARIANTS[0]}")
shift
;;
purple)
themes+=("${THEME_VARIANTS[1]}")
shift
;;
pink)
themes+=("${THEME_VARIANTS[2]}")
shift
;;
red)
themes+=("${THEME_VARIANTS[3]}")
shift
;;
orange)
themes+=("${THEME_VARIANTS[4]}")
shift
;;
yellow)
themes+=("${THEME_VARIANTS[5]}")
shift
;;
green)
themes+=("${THEME_VARIANTS[6]}")
shift
;;
teal)
themes+=("${THEME_VARIANTS[7]}")
shift
;;
grey)
themes+=("${THEME_VARIANTS[8]}")
shift
;;
all)
themes+=("${THEME_VARIANTS[@]}")
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized theme variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
;;
-c|--color)
shift
for variant in "$@"; do
case "$variant" in
standard)
colors+=("${COLOR_VARIANTS[0]}")
lcolors+=("${COLOR_VARIANTS[0]}")
shift
;;
light)
colors+=("${COLOR_VARIANTS[1]}")
lcolors+=("${COLOR_VARIANTS[1]}")
shift
;;
dark)
colors+=("${COLOR_VARIANTS[2]}")
lcolors+=("${COLOR_VARIANTS[2]}")
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized color variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
;;
-s|--size)
shift
for variant in "$@"; do
case "$variant" in
standard)
sizes+=("${SIZE_VARIANTS[0]}")
shift
;;
compact)
sizes+=("${SIZE_VARIANTS[1]}")
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized size variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
;;
-i|--icon)
activities='icon'
shift
for icons in "$@"; do
case "$icons" in
default)
icon='-default'
shift
;;
apple)
icon='-apple'
shift
;;
simple)
icon='-simple'
shift
;;
gnome)
icon='-gnome'
shift
;;
ubuntu)
icon='-ubuntu'
shift
;;
arch)
icon='-arch'
shift
;;
manjaro)
icon='-manjaro'
shift
;;
fedora)
icon='-fedora'
shift
;;
debian)
icon='-debian'
shift
;;
void)
icon='-void'
shift
;;
opensuse)
icon='-opensuse'
shift
;;
popos)
icon='-popos'
shift
;;
mxlinux)
icon='-mxlinux'
shift
;;
zorin)
icon='-zorin'
shift
;;
endeavouros)
icon='-endeavouros'
shift
;;
tux)
icon='-tux'
shift
;;
nixos)
icon='-nixos'
shift
;;
gentoo)
icon='-gentoo'
shift
;;
budgie)
icon='-budgie'
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized icon variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
echo "Install $icons icon for gnome-shell panel..."
done
;;
-h|--help)
usage
exit 0
;;
*)
echo "ERROR: Unrecognized installation option '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
if [[ "${#themes[@]}" -eq 0 ]] ; then
themes=("${THEME_VARIANTS[0]}")
fi
if [[ "${#colors[@]}" -eq 0 ]] ; then
colors=("${COLOR_VARIANTS[@]}")
fi
if [[ "${#sizes[@]}" -eq 0 ]] ; then
sizes=("${SIZE_VARIANTS[@]}")
fi
if [[ "${#lcolors[@]}" -eq 0 ]] ; then
lcolors=("${COLOR_VARIANTS[1]}")
fi
if [[ ${remove} == 'true' ]]; then
if [[ "$libadwaita" == 'true' ]]; then
uninstall_link
elif [[ "$all" == 'true' ]]; then
uninstall_theme && uninstall_link
else
uninstall_theme
fi
else
if [[ "$libadwaita" == 'true' && "$UID" == "$ROOT_UID" ]]; then
echo -e "Do not run -l with sudo, that will link libadwaita theme to root folder !"
exit 0
fi
clean_theme
install_theme
if [[ "$libadwaita" == 'true' && "$UID" != "$ROOT_UID" ]]; then
link_theme
fi
if [[ "$dockfix" == 'true' ]]; then
fix_dash_to_dock
fi
fi
echo
echo "Done."