-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyggdrasil.sh
executable file
·373 lines (352 loc) · 9.96 KB
/
yggdrasil.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
#!/bin/bash
#-----------------------------------------------------------------------------#
# Yggdrasil NG #
# compatibility : Mint 19, Ubuntu 18.04 #
# author : Francois B. (Makotosan/Shakasan) #
# licence : GPLv3 #
# website : https://makotonoblog.be/ #
#-----------------------------------------------------------------------------#
#
# include functions and vars from external files
#
dir=$(dirname $0)
source /opt/yggdrasil/vars.sh || exit 1
source /opt/yggdrasil/core_functions.sh || exit 1
source /opt/yggdrasil/tools_functions.sh || exit 1
OS=`lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}'`
case $OS in
*"Ubuntu 16.04"* | *"Linux Mint 18"*)
printf "\n"
printf $BOLDROUGE"Yggdrasil for Ubuntu 16.04 / Linux Mint 18 is no longer available.\n"$NORMAL
printf "If you still need it, use an older version of Yggdrasil previous to 0.5.1.\n"
printf "Thanks for using Yggdrasil"
printf "\n"
;;
*"Ubuntu 18.04"* | *"Linux Mint 19"*)
source /opt/yggdrasil/repo_functions_ub1804.sh || exit 1
source /opt/yggdrasil/install_functions_ub1804.sh || exit 1
source /opt/yggdrasil/menus_functions_ub1804.sh || exit 1
;;
*"Ubuntu 20.04"* | *"Linux Mint 20"*)
source /opt/yggdrasil/repo_functions_ub2004.sh || exit 1
source /opt/yggdrasil/install_functions_ub2004.sh || exit 1
source /opt/yggdrasil/menus_functions_ub2004.sh || exit 1
;;
*)
printf "\n"
printf $BOLDROUGE"Linux distro not supported"$NORMAL
printf "\n\n"
;;
esac
#
# check if the script is running in root/sudo
# NEVER run the script as root or with sudo !!!!
#
if ! [ "$UID" -ne "0" ]; then
printf "\n"
printf $BOLDROUGE"Yggdrasil can't be run as root/sudo, please retry as normal user"$NORMAL
printf "\n\n"
exit
fi
#
# add a mark to the log file at every script run
#
echo "--[ Yggdrasil log ]--[ "$cDate" ]--[ "$cTime" ]-----------------------" >> $logFile
#-----------------------------------------------------------------------------#
# Headless Mode #
#-----------------------------------------------------------------------------#
# display logo in CLI mode
[[ $# -gt 0 ]] && dispLogo
#
# arguments/options management with getopts
while getopts ":h,v,f,c,u,a,d,q,s,t,w,g,j,k,p" option; do
case "$option" in
a) # install all apps
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Apps"
installAppsFromList base
installAppsFromList office
installAppsFromList burningtools
installAppsFromList ebook
installAppsFromList games
installAppsFromList steam
installAppsFromList internet
installAppsFromList java11
installAppsFromList utilities
installAppsFromList multimedia
installAppsFromList nettools
installAppsFromList wine
installAppsFromList cajaplugins
installAppsFromList nautilus
installAppsFromList thunar
installAppsFromList gimp
installAppsFromList pidgin
installAppsFromList rhythmbox
msg "Installing HW related"
installAppsFromList webcam
updateMicrocode
msg "Applying system customizations"
enableHistoryTS
msg "Installing external apps"
installViber
installBoostnotes
installTeamViewer13
installAppImageLauncher
installXnViewMP
;;
f) # full install
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Apps"
installAppsFromList base
installAppsFromList office
installAppsFromList burningtools
installAppsFromList ebook
installAppsFromList games
installAppsFromList steam
installAppsFromList internet
installAppsFromList java11
installAppsFromList utilities
installAppsFromList multimedia
installAppsFromList nettools
installAppsFromList wine
installAppsFromList cajaplugins
installAppsFromList nautilus
installAppsFromList thunar
installAppsFromList gimp
installAppsFromList pidgin
installAppsFromList rhythmbox
msg "Installing HW related"
installAppsFromList webcam
updateMicrocode
installAppsFromList cardreader
msg "Applying system customizations"
enableHistoryTS
installAppsFromList unbound
msg "Installing additional themes/icons"
installAppsFromList icons
installAppsFromList gtkthemes
msg "Installing external apps"
installViber
installBoostnotes
installTeamViewer13
installAppImageLauncher
installXnViewMP
;;
c) # install themes and icons
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Icons/Themes"
installAppsFromList icons
installAppsFromList gtkthemes
;;
w) # nitrogen
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Nitrogen"
installAppsFromList nitrogen
;;
d) # install Unbound DNS Cache
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Unbound"
installAppsFromList unbound
;;
q) # cardreader
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Card Readers Apps"
installAppsFromList cardreader
;;
s) # solaar for logitech devices
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing Solaar"
installAppsFromList solaar
;;
t) # tlp (laptop or low energy usage)
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing TLP"
installAppsFromList tlp
;;
k) # Ubuntu Hardware Enablement Stack
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Installing HWE (newer kernel+xorg)"
installAppsFromList hwe
;;
g) # Unlock+Install SNAP + Store
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Unlock/Install SNAP + Store"
installAppsFromList snap
;;
j) # unattended-upgrades
if [ $ygginitCount = false ]; then
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
ygginitCount=true
fi
msg "Install/Enable unattended-upgrades"
installAppsFromList unattended-upgrades
;;
u)
msg "Initializing"
yggInit
msg "Updating the system"
updateSystem
exit
;;
p)
msg "Removing useless dependencies"
toolAutoremove
exit
;;
h) # display help
usage
exit
;;
v) # display version number
printf "Yggdrasil version : $version\n"
exit
;;
:) # display error message in case of missing argument(s)
usage
printf "\nError : Option $OPTARG : missing argument\n"
exit 1
;;
\?) # display error message in case of invalid option
usage
printf "\nError : $OPTARG : invalid option\n"
exit 1
;;
esac
done
# if CLI mode, no need to run the menus...
[[ $# -gt 0 ]] && exit
#-----------------------------------------------------------------------------#
# Menu Mode #
#-----------------------------------------------------------------------------#
# show Yggdrasil logo
dispLogo
# show system informations
dispSysInfos
# Useless by itself, but is used to don't be annoyed later in the script
sudo echo
# init, check and install/update dependencies
yggInit
pressKey
# Apps dir created if necessary
mkdir -p /home/$myHomedir/Apps
#-----------------------------------------------------------------------------#
# Main menu #
#-----------------------------------------------------------------------------#
while true; do # main menu loop
mainMenuOptions=$(whiptail \
--title "Yggdrasil $version - Main Menu" \
--menu "This tool will help you to install all needed applications and cutomize your fresh install of Mint/Ubuntu/Elementary/..." \
25 80 16 \
"1" "System update" \
"2" "Applications" \
"3" "Themes & Icons" \
"4" "Dev Apps" \
"5" "System Config" \
"6" "Hardware" \
"7" "System Tools" \
"8" "Add Makoto no Blog repository" \
"9" "Reboot this computer" \
"10" "About Yggdrasil" \
"11" "Quit" 3>&1 1>&2 2>&3)
case $mainMenuOptions in
"1")
updateSystem
pressKey
;;
"2")
showAppInstallMenu
;;
"3")
showThemesInstallMenu
;;
"4")
showDevInstallMenu
;;
"5")
showConfigMenu;
;;
"6")
showHardwareMenu
;;
"7")
showSysToolsMenu
;;
"8")
addRepo_Makoto
;;
"9")
showRebootBoxMenu
;;
"10")
showAboutBoxMenu
;;
"11")
exit
;;
esac # main menu
done # end of main menu loop
clear
exit