forked from vinceliuice/Vimix-gtk-themes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vimix-installer
executable file
·350 lines (263 loc) · 8.98 KB
/
Vimix-installer
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
#! /bin/bash
show_question() {
echo -e "\033[1;34m$@\033[0m"
}
show_dir() {
echo -e "\033[1;32m$@\033[0m"
}
show_error() {
echo -e "\033[1;31m$@\033[0m"
}
end() {
echo -e "\nExiting...\n"
exit 0
}
continue() {
show_question "\nDo you want to continue? (y)es, (n)o : \n"
read INPUT
case $INPUT in
[Yy]* ) ;;
[Nn]* ) end;;
* ) show_error "\nSorry, try again."; continue;;
esac
}
replace() {
show_question "\nFound an existing installation. Replace it? (y)es, (n)o :\n"
read INPUT
case $INPUT in
[Yy]* ) rm -rf $DEST_DIR/Vimix*;;
[Nn]* ) ;;
* ) show_error "\nSorry, try again."; replace $@;;
esac
}
setup() {
show_question "\nDo you want to set the theme now? (y)es, (n)o : \n"
read INPUT
case $INPUT in
[Yy]* ) themes;;
[Nn]* ) end;;
* ) show_error "\nSorry, try again."; setup;;
esac
}
themes() {
show_question "\n+------------------------------------------------------------------+
Select a number to set the theme you want:
(a) VimixDark
(b) VimixDark-Doder
(c) VimixDark-Beryl
(d) VimixDark-Ruby
(e) VimixDark-Laptop
(f) VimixDark-Laptop-Doder
(g) VimixDark-Laptop-Beryl
(h) VimixDark-Laptop-Ruby
(i) VimixLight
(j) VimixLight-Doder
(k) VimixLight-Beryl
(l) VimixLight-Ruby
(m) VimixLight-Laptop
(n) VimixLight-Laptop-Doder
(o) VimixLight-Laptop-Beryl
(p) VimixLight-Laptop-Ruby
+------------------------------------------------------------------+\n"
read INPUT
case $INPUT in
[Aa]* ) VimixDark;;
[Bb]* ) VimixDark-Doder;;
[Cc]* ) VimixDark-Beryl;;
[Dd]* ) VimixDark-Ruby;;
[Ee]* ) VimixDark-Laptop;;
[Ff]* ) VimixDark-Laptop-Doder;;
[Gg]* ) VimixDark-Laptop-Beryl;;
[Hh]* ) VimixDark-Laptop-Ruby;;
[Ii]* ) VimixLight;;
[Jj]* ) VimixLight-Doder;;
[Kk]* ) VimixLight-Beryl;;
[Ll]* ) VimixLight-Ruby;;
[Mm]* ) VimixLight-Laptop;;
[Nn]* ) VimixLight-Laptop-Doder;;
[Oo]* ) VimixLight-Laptop-Beryl;;
[Pp]* ) VimixLight-Laptop-Ruby;;
* ) show_error "\nSorry, try again."; themes;;
esac
}
VimixDark() {
# Set VimixDark Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark
gsettings set org.gnome.desktop.wm.preferences theme VimixDark
echo "Done!"
}
VimixDark-Doder() {
# Set VimixDark-Doder Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Doder
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Doder
echo "Done!"
}
VimixDark-Beryl() {
# Set VimixDark-Beryl Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Beryl
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Beryl
echo "Done!"
}
VimixDark-Ruby() {
# Set VimixDark-Ruby Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Ruby
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Ruby
echo "Done!"
}
VimixDark-Laptop() {
# Set VimixDark-Laptop Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Laptop
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Laptop
echo "Done!"
}
VimixDark-Laptop-Doder() {
# Set VimixDark-Laptop-Doder Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Laptop-Doder
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Laptop-Doder
echo "Done!"
}
VimixDark-Laptop-Beryl() {
# Set VimixDark-Laptop-Beryl Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Laptop-Beryl
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Laptop-Beryl
echo "Done!"
}
VimixDark-Laptop-Ruby() {
# Set VimixDark-Laptop-Ruby Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixDark-Laptop-Ruby
gsettings set org.gnome.desktop.wm.preferences theme VimixDark-Laptop-Ruby
echo "Done!"
}
VimixLight() {
# Set VimixLight Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight
gsettings set org.gnome.desktop.wm.preferences theme VimixLight
echo "Done!"
}
VimixLight-Doder() {
# Set VimixLight-Doder Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Doder
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Doder
echo "Done!"
}
VimixLight-Beryl() {
# Set VimixLight-Beryl Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Beryl
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Beryl
echo "Done!"
}
VimixLight-Ruby() {
# Set VimixLight-Ruby Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Ruby
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Ruby
echo "Done!"
}
VimixLight-Laptop() {
# Set VimixLight-Laptop Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Laptop
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Laptop
echo "Done!"
}
VimixLight-Laptop-Doder() {
# Set VimixLight-Laptop-Doder Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Laptop-Doder
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Laptop-Doder
echo "Done!"
}
VimixLight-Laptop-Beryl() {
# Set VimixLight-Laptop-Beryl Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Laptop-Beryl
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Laptop-Beryl
echo "Done!"
}
VimixLight-Laptop-Ruby() {
# Set VimixLight-Laptop-Ruby Gtk Themes
echo "Setting the theme..."
gsettings set org.gnome.desktop.interface gtk-theme VimixLight-Laptop-Ruby
gsettings set org.gnome.desktop.wm.preferences theme VimixLight-Laptop-Ruby
echo "Done!"
}
install() {
# PREVIEW
# Show destination directory
echo -e "\nVimix Gtk Theme will be installed in:\n"
show_dir "\t$DEST_DIR"
if [ "$UID" -eq "$ROOT_UID" ]; then
echo -e "\nIt will be available to all users."
else
echo -e "\nIf you want to make them available to all users, run this script as root."
fi
continue
# INSTALL
# Check destination directory
if [ ! -d $DEST_DIR ]; then
mkdir -p $DEST_DIR
elif [[ -d $DEST_DIR/VimixDark && -d $DEST_DIR/VimixDark-Doder && -d $DEST_DIR/VimixDark-Beryl && -d $DEST_DIR/VimixDark-Ruby && -d $DEST_DIR/VimixDark-Laptop && -d $DEST_DIR/VimixDark-Laptop-Doder && -d $DEST_DIR/VimixDark-Laptop-Beryl && -d $DEST_DIR/VimixDark-Laptop-Ruby && -d $DEST_DIR/VimixLight && -d $DEST_DIR/VimixLight-Doder && -d $DEST_DIR/VimixLight-Beryl && -d $DEST_DIR/VimixLight-Ruby && -d $DEST_DIR/VimixLight-Laptop && -d $DEST_DIR/VimixLight-Laptop-Doder && -d $DEST_DIR/VimixLight-Laptop-Beryl && -d $DEST_DIR/VimixLight-Laptop-Ruby ]]; then
replace $DEST_DIR
fi
echo -e "\nInstalling Vimix..."
# Copying files
./Install
echo -e "\nInstallation complete!"
setup
}
remove() {
# PREVIEW
# Show installation directory
if [[ -d $DEST_DIR/VimixDark && -d $DEST_DIR/VimixDark-Doder && -d $DEST_DIR/VimixDark-Beryl && -d $DEST_DIR/VimixDark-Ruby && -d $DEST_DIR/VimixDark-Laptop && -d $DEST_DIR/VimixDark-Laptop-Doder && -d $DEST_DIR/VimixDark-Laptop-Beryl && -d $DEST_DIR/VimixDark-Laptop-Ruby && -d $DEST_DIR/VimixLight && -d $DEST_DIR/VimixLight-Doder && -d $DEST_DIR/VimixLight-Beryl && -d $DEST_DIR/VimixLight-Ruby && -d $DEST_DIR/VimixLight-Laptop && -d $DEST_DIR/VimixLight-Laptop-Doder && -d $DEST_DIR/VimixLight-Laptop-Beryl && -d $DEST_DIR/VimixLight-Laptop-Ruby ]]; then
echo -e "\nVimix Gtk Themes installed in:\n"
show_dir "\t$DEST_DIR"
if [ "$UID" -eq "$ROOT_UID" ]; then
echo -e "\nIt will remove for all users."
else
echo -e "\nIt will remove only for current user."
fi
continue
else
show_error "\nVimix Gtk Themes is not installed in:\n"
show_dir "\t$DEST_DIR\n"
end
fi
# REMOVE
echo -e "\nRemoving Vimix ..."
# Removing files
rm -rf $DEST_DIR/Vimix*
echo "Removing complete!"
echo "I hope to see you soon."
}
main() {
show_question "What you want to do: (i)nstall, (r)emove : \n"
read INPUT
case $INPUT in
[Ii]* ) install;;
[Rr]* ) remove;;
* ) show_error "\nSorry, try again."; main;;
esac
}
ROOT_UID=0
DEST_DIR=
# Destination directory
if [ "$UID" -eq "$ROOT_UID" ]; then
DEST_DIR="/usr/share/themes"
else
DEST_DIR="$HOME/.themes"
fi
echo -e "\e[1m\n+----------------------------------------------+"
echo -e "| Vimix Gtk Themes Installer Script |"
echo -e "+----------------------------------------------+\n\e[0m"
main