-
Notifications
You must be signed in to change notification settings - Fork 12
/
gnome_config.sh
executable file
·382 lines (321 loc) · 9.52 KB
/
gnome_config.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
#!/bin/env bash
## author: si9ma
## my blog: si9ma.com
##
## use this script to config gnome
##
# there are a bug when use log in this script(can't use yaourt)
. log.sh
# don't run this script as root
. no_root.sh
# import yaourt functions
. yaourt.sh
HEADER="Archlinux Installer"
EXIT_MSG="You have left from Archlinux Installer!"
# get usrname
usrname=$(whoami)
function enable_extensions
{
cur=$(gsettings get org.gnome.shell enabled-extensions)
if [ "$cur" = "@as []" ]
then
new="['$1']"
else
cur=${cur/\]/,}
new="${cur}'$1']"
fi
# set
gsettings set org.gnome.shell enabled-extensions "$new"
}
# configure Gnome Appearance
title="Gnome Appearance"
msg="Would you want to configure your Gnome appearance? [Yes] to configure. [No] to use default appearance. [ESC] to exit the installer.\n\nPlease confirm before typing the [ENTER], because you can't undo it."
dialog --ascii-lines --title "$title" --backtitle "$HEADER" --yesno "$msg" 11 45
## operating
retval=$?
echo
case $retval in
255) # ESC,exit
echo
echo $EXIT_MSG
exit 255
;;
1) # bash /home/$usrname/Archlinux-Installer/chinese_config.sh
./chinese_config.sh
;;
0)
## GTK+ theme
title="Gnome Appearance - GTK+ Theme"
msg="Please select a GTK+ theme. [ESC] to exit the installer.\n\nPlease confirm before typing the [ENTER], because you can't undo it."
dialog --no-cancel --ok-button "Select" --ascii-lines --title "$title" --backtitle "$HEADER" --menu "$msg" 18 75 18 "Adwaita" "Adwaita (local)" "Adwaita-dark" "Adwaita-dark (local)" "HighContrast" "HighContrast (local)" "OSX-Arc-White" "OSX-Arc-White (remote)" "OSX-Arc-Darker" "OSX-Arc-Darker (remote)" "OSX-Arc-Shadow" "OSX-Arc-Shadow (remote)" "OSX-Arc-Plus" "OSX-Arc-Plus (remote)" 2>tempfile
retval=$?
choice=$(cat tempfile)
echo
case $retval in
255) # ESC,exit
echo
echo $EXIT_MSG
exit 255
;;
esac
# OSX-Arc-White
if [ "$choice" = "OSX-Arc-White" ]
then
# download OSX-Arc-White
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-white
else
install_yaourt
yaourt --noconfirm -S osx-arc-white
fi
white=1
elif [ "$choice" = "OSX-Arc-Darker" ]
then
# Download OSX-Arc-Darker
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-darker
else
install_yaourt
yaourt --noconfirm -S osx-arc-darker
fi
darker=1
elif [ "$choice" = "OSX-Arc-Shadow" ]
then
# Download OSX-Arc-Shadow
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-shadow
else
install_yaourt
yaourt --noconfirm -S osx-arc-shadow
fi
shadow=1
elif [ "$choice" = "OSX-Arc-Plus" ]
then
# Download OSX-Arc-Plus
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-plus
else
install_yaourt
yaourt --noconfirm -S osx-arc-plus
fi
plus=1
fi
# set GTK+ themes
gsettings set org.gnome.desktop.interface gtk-theme $choice
## icons themes
title="Gnome Appearance - Icons"
msg="Please select a Icons theme. [ESC] to exit the installer.\n\nPlease confirm before typing the [ENTER], because you can't undo it."
dialog --no-cancel --ok-button "Select" --ascii-lines --title "$title" --backtitle "$HEADER" --menu "$msg" 18 75 18 "Adwaita" "Adwaita (local)" "hicolor" "hicolor (local)" "HighContrast" "HighContrast (local)" "macOS" "macOS (remote)" "Numix" "Numix (remote)" "Numix-Light" "Numix-Light (remote)" "Numix-Circle" "Numix-Circle (remote)" "Numix-Circle-Light" "Numix-Circle-Light (remote)" 2>tempfile
retval=$?
choice=$(cat tempfile)
echo
case $retval in
255) # ESC,exit
echo
echo $EXIT_MSG
exit 255
;;
esac
if [ "$choice" = "Numix" ] || [ "$choice" = "Numix-Light" ]
then
# Download
rm -rf ~/Numix
git clone https://github.com/numixproject/numix-icon-theme.git ~/Numix
mkdir -p ~/.icons
rm -rf ~/.icons/Numix
rm -rf ~/.icons/Numix-Light
mv ~/Numix/Numix ~/.icons/
mv ~/Numix/Numix-Light ~/.icons/
elif [ "$choice" = "Numix-Circle" ] || [ "$choice" = "Numix-Circle-Light" ]
then
# Download
rm -rf ~/Numix-Circle
git clone https://github.com/numixproject/numix-icon-theme-circle.git ~/Numix-Circle
mkdir -p ~/.icons
rm -rf ~/.icons/Numix-Circle
rm -rf ~/.icons/Numix-Circle-Light
mv ~/Numix-Circle/Numix-Circle ~/.icons/
mv ~/Numix-Circle/Numix-Circle-Light ~/.icons/
elif [ "$choice" = "macOS" ]
then
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S macos-icon-theme
else
install_yaourt
yaourt --noconfirm -S macos-icon-theme
fi
fi
# set icons
gsettings set org.gnome.desktop.interface icon-theme $choice
## shell theme
title="Gnome Appearance - Shell Theme"
msg="Please select a Shell theme. [ESC] to exit the installer.\n\nPlease confirm before typing the [ENTER], because you can't undo it."
dialog --no-cancel --ok-button "Select" --ascii-lines --title "$title" --backtitle "$HEADER" --menu "$msg" 18 75 18 "Yosemite-Shell" "Yosemite-Shell (remote)" "OSX-Arc-White" "OSX-Arc-White (remote)" "OSX-Arc-Darker" "OSX-Arc-Darker (remote)" "OSX-Arc-Shadow" "OSX-Arc-Shadow (remote)" "OSX-Arc-Plus" "OSX-Arc-Plus (remote)" 2>tempfile
retval=$?
choice=$(cat tempfile)
echo
case $retval in
255) # ESC,exit
echo
echo echo $EXIT_MSG
exit 255
;;
esac
# OSX-Arc-White
if [ "$choice" = "OSX-Arc-White" ]
then
if [ "$white" != "1" ]
then
# download OSX-Arc-White
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-white
else
install_yaourt
yaourt --noconfirm -S osx-arc-white
fi
fi
elif [ "$choice" = "OSX-Arc-Darker" ]
then
if [ "$darker" != "1" ]
then
# Download OSX-Arc-Darker
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-darker
else
install_yaourt
yaourt --noconfirm -S osx-arc-darker
fi
fi
elif [ "$choice" = "OSX-Arc-Shadow" ]
then
if [ "$shadow" != "1" ]
then
# Download OSX-Arc-Shadow
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-shadow
else
install_yaourt
yaourt --noconfirm -S osx-arc-shadow
fi
fi
elif [ "$choice" = "OSX-Arc-Plus" ]
then
if [ "$plus" != "1" ]
then
# Download OSX-Arc-Plus
val=$(check_yaourt)
# have install yaourt
if [ "$val" = "0" ]
then
yaourt --noconfirm -S osx-arc-plus
else
install_yaourt
yaourt --noconfirm -S osx-arc-plus
fi
fi
elif [ "$choice" = "Yosemite-Shell" ]
then
# Install
rm -rf ~/.themes/Yosemite-Shell
git clone https://github.com/nicksniffer/Yosemite-Shell.git ~/.themes/Yosemite-Shell
fi
# set GTK+ themes
# enable user shell
enable_extensions [email protected]
gsettings set org.gnome.shell.extensions.user-theme name $choice
## Gnome shell extensions
# check the status of yaourt.
val=$(check_yaourt)
# have install yaourt
if [ "$val" != "0" ]
then
install_yaourt
fi
# window
title="Gnome Appearance"
msg="Please select the Gnome shell extensions you want to enable. [ESC] to exit the installer.\n\nPlease confirm before typing the [ENTER], because you can't undo it."
dialog --ascii-lines --title "$title" --backtitle "$HEADER" --checklist "$msg" 18 77 18 \
"Dash-to-dock" "A dock for the gnome shell" "OFF"\
"Topicons-Plus" "This extension moves legacy tray icons" "OFF"\
"System-monitor" "Display system information in gnome shell status bar,such as memory usage,cpu usage,network retes..." "OFF" 2>tempfile
# "Launch-new-instance" "Always launch a new instance when clicking in the dash or the application view." "OFF"\
# "Removable-drive-menu" "A status menu for accessing and unmounting Removable devices." "OFF"\
# "Screenshot-tool" "Conveniently create,copy,store and uplosd screenshots" "OFF"\
retval=$?
choice=$(cat tempfile)
echo
case $retval in
255)# ESC,exit
echo
echo $EXIT_MSG
exit 255
;;
esac
function install_dash_to_dock
{
yaourt --noconfirm -S gnome-shell-extension-dash-to-dock-git
# enable
enable_extensions [email protected]
# icons size
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 33
# bottom
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
}
function install_topicons_plus
{
yaourt --noconfirm -S gnome-shell-extension-topicons-plus
enable_extensions [email protected]
}
function install_system_monitor
{
yaourt --noconfirm -S gnome-shell-extension-system-monitor-git
enable_extensions [email protected]
}
# install extensions
for extension in $choice
do
if [ "$extension" = "Dash-to-dock" ]
then
install_dash_to_dock
elif [ "$extension" = "Topicons-Plus" ]
then
install_topicons_plus
elif [ "$extension" = "System-monitor" ]
then
install_system_monitor
elif [ "$extension" = "Launch-new-instance" ]
then
enable_extensions [email protected]
elif [ "$extension" = "Removable-drive-menu" ]
then
enable_extensions [email protected]
fi
done
## chinese configure
bash /home/$usrname/Archlinux-Installer/chinese_config.sh
;;
esac