2017-12-27 13:54:15 +00:00
|
|
|
#!/bin/bash
|
2020-02-22 19:57:42 +00:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Yggdrasil NG #
|
|
|
|
# compatibility : Mint 19, Ubuntu 18.04 #
|
|
|
|
# author : Francois B. (Makotosan/Shakasan) #
|
|
|
|
# licence : GPLv3 #
|
|
|
|
# website : https://makotonoblog.be/ #
|
|
|
|
#-----------------------------------------------------------------------------#
|
2017-12-27 13:54:15 +00:00
|
|
|
|
|
|
|
#
|
2017-12-30 22:08:45 +00:00
|
|
|
# include functions and vars from external files
|
2017-12-27 13:54:15 +00:00
|
|
|
#
|
2018-03-22 12:53:16 +00:00
|
|
|
dir=$(dirname $0)
|
2018-06-05 12:29:41 +00:00
|
|
|
source /opt/yggdrasil/vars.sh || exit 1
|
|
|
|
source /opt/yggdrasil/core_functions.sh || exit 1
|
|
|
|
source /opt/yggdrasil/tools_functions.sh || exit 1
|
2018-05-26 21:25:15 +00:00
|
|
|
|
|
|
|
OS=`lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}'`
|
2018-05-26 22:58:00 +00:00
|
|
|
case $OS in
|
2018-05-30 07:09:12 +00:00
|
|
|
*"Ubuntu 16.04"* | *"Linux Mint 18"*)
|
2019-07-09 20:36:54 +00:00
|
|
|
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"
|
2018-05-26 22:58:00 +00:00
|
|
|
;;
|
2018-05-30 07:09:12 +00:00
|
|
|
*"Ubuntu 18.04"* | *"Linux Mint 19"*)
|
2018-06-05 12:29:41 +00:00
|
|
|
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
|
2018-05-26 22:58:00 +00:00
|
|
|
;;
|
2020-02-23 18:09:36 +00:00
|
|
|
*"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
|
|
|
|
;;
|
2018-05-26 22:58:00 +00:00
|
|
|
*)
|
|
|
|
printf "\n"
|
2018-05-29 11:02:06 +00:00
|
|
|
printf $BOLDROUGE"Linux distro not supported"$NORMAL
|
2018-05-26 22:58:00 +00:00
|
|
|
printf "\n\n"
|
|
|
|
;;
|
|
|
|
esac
|
2017-12-27 13:54:15 +00:00
|
|
|
|
|
|
|
#
|
2017-12-30 22:08:45 +00:00
|
|
|
# check if the script is running in root/sudo
|
2017-12-29 10:46:53 +00:00
|
|
|
# NEVER run the script as root or with sudo !!!!
|
2017-12-30 22:08:45 +00:00
|
|
|
#
|
2017-12-29 10:46:53 +00:00
|
|
|
if ! [ "$UID" -ne "0" ]; then
|
|
|
|
printf "\n"
|
2018-03-22 10:36:39 +00:00
|
|
|
printf $BOLDROUGE"Yggdrasil can't be run as root/sudo, please retry as normal user"$NORMAL
|
2017-12-29 10:46:53 +00:00
|
|
|
printf "\n\n"
|
|
|
|
exit
|
|
|
|
fi
|
2017-12-27 13:54:15 +00:00
|
|
|
|
2017-12-30 22:08:45 +00:00
|
|
|
#
|
2017-12-27 13:54:15 +00:00
|
|
|
# add a mark to the log file at every script run
|
2017-12-30 22:08:45 +00:00
|
|
|
#
|
2017-12-29 15:43:47 +00:00
|
|
|
echo "--[ Yggdrasil log ]--[ "$cDate" ]--[ "$cTime" ]-----------------------" >> $logFile
|
2017-12-27 13:54:15 +00:00
|
|
|
|
2017-12-30 22:08:45 +00:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Headless Mode #
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
|
2018-05-30 11:15:57 +00:00
|
|
|
# display logo in CLI mode
|
|
|
|
[[ $# -gt 0 ]] && dispLogo
|
|
|
|
|
2017-12-29 10:46:53 +00:00
|
|
|
#
|
|
|
|
# arguments/options management with getopts
|
2018-03-30 07:39:12 +00:00
|
|
|
|
2019-07-10 20:50:00 +00:00
|
|
|
while getopts ":h,v,f,c,u,a,d,q,s,t,w,k,p" option; do
|
2017-12-29 10:46:53 +00:00
|
|
|
case "$option" in
|
2018-03-24 16:08:01 +00:00
|
|
|
a) # install all apps
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing Apps"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList base
|
|
|
|
installAppsFromList office
|
2018-08-04 04:44:27 +00:00
|
|
|
installAppsFromList burningtools
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList ebook
|
|
|
|
installAppsFromList games
|
|
|
|
installAppsFromList steam
|
|
|
|
installAppsFromList internet
|
2019-07-14 17:25:54 +00:00
|
|
|
installAppsFromList java11
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList utilities
|
|
|
|
installAppsFromList multimedia
|
|
|
|
installAppsFromList nettools
|
|
|
|
installAppsFromList wine
|
|
|
|
installAppsFromList cajaplugins
|
|
|
|
installAppsFromList nautilus
|
|
|
|
installAppsFromList thunar
|
|
|
|
installAppsFromList gimp
|
|
|
|
installAppsFromList pidgin
|
|
|
|
installAppsFromList rhythmbox
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing HW related"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList webcam
|
2018-03-24 16:08:01 +00:00
|
|
|
updateMicrocode
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Applying system customizations"
|
2018-03-24 16:08:01 +00:00
|
|
|
enableUFW
|
|
|
|
enableNumLockX
|
|
|
|
addScreenfetchBashrc
|
|
|
|
enableHistoryTS
|
|
|
|
installUnattendedUpgrades
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing external apps"
|
|
|
|
installViber
|
|
|
|
installFranz
|
2018-06-12 06:58:12 +00:00
|
|
|
installBoostnotes
|
2018-03-30 07:39:12 +00:00
|
|
|
installTeamViewer13
|
2018-05-27 13:18:46 +00:00
|
|
|
installXnViewMP
|
2020-02-22 19:57:42 +00:00
|
|
|
installAppImageLauncher
|
2018-03-24 16:24:42 +00:00
|
|
|
;;
|
2018-03-24 16:08:01 +00:00
|
|
|
f) # full install
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing Apps"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList base
|
|
|
|
installAppsFromList office
|
2018-08-04 04:44:27 +00:00
|
|
|
installAppsFromList burningtools
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList ebook
|
|
|
|
installAppsFromList games
|
|
|
|
installAppsFromList steam
|
|
|
|
installAppsFromList internet
|
2019-07-14 17:25:54 +00:00
|
|
|
installAppsFromList java11
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList utilities
|
|
|
|
installAppsFromList multimedia
|
|
|
|
installAppsFromList nettools
|
|
|
|
installAppsFromList wine
|
|
|
|
installAppsFromList cajaplugins
|
|
|
|
installAppsFromList nautilus
|
|
|
|
installAppsFromList thunar
|
|
|
|
installAppsFromList gimp
|
|
|
|
installAppsFromList pidgin
|
|
|
|
installAppsFromList rhythmbox
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing HW related"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList webcam
|
2018-03-24 16:08:01 +00:00
|
|
|
updateMicrocode
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList cardreader
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Applying system customizations"
|
2018-03-24 16:08:01 +00:00
|
|
|
enableUFW
|
|
|
|
enableNumLockX
|
|
|
|
addScreenfetchBashrc
|
|
|
|
enableHistoryTS
|
|
|
|
installUnattendedUpgrades
|
2018-08-04 04:44:27 +00:00
|
|
|
installAppsFromList unbound
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing additional themes/icons"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList icons
|
|
|
|
installAppsFromList gtkthemes
|
2018-03-30 07:39:12 +00:00
|
|
|
msg "Installing external apps"
|
|
|
|
installViber
|
|
|
|
installFranz
|
2018-06-12 06:58:12 +00:00
|
|
|
installBoostnotes
|
2018-03-30 07:39:12 +00:00
|
|
|
installTeamViewer13
|
2018-05-27 13:18:46 +00:00
|
|
|
installXnViewMP
|
2020-02-22 19:57:42 +00:00
|
|
|
installAppImageLauncher
|
2017-12-29 10:46:53 +00:00
|
|
|
;;
|
|
|
|
c) # install themes and icons
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Installing Icons/Themes"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList icons
|
|
|
|
installAppsFromList gtkthemes
|
2017-12-29 10:46:53 +00:00
|
|
|
;;
|
2018-03-30 07:39:12 +00:00
|
|
|
w) # nitrogen
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Installing Nitrogen"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList nitrogen
|
2018-03-30 07:39:12 +00:00
|
|
|
;;
|
2018-03-24 16:20:26 +00:00
|
|
|
d) # install Unbound DNS Cache
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Installing Unbound"
|
2018-06-13 03:13:39 +00:00
|
|
|
installAppsFromList unbound
|
2018-03-24 16:20:26 +00:00
|
|
|
;;
|
2018-03-30 07:39:12 +00:00
|
|
|
q) # cardreader
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Installing Card Readers Apps"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList cardreader
|
2018-03-24 16:20:26 +00:00
|
|
|
;;
|
|
|
|
s) # solaar for logitech devices
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Installing Solaar"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList solaar
|
2018-03-24 16:20:26 +00:00
|
|
|
;;
|
|
|
|
t) # tlp (laptop or low energy usage)
|
2018-06-05 12:21:47 +00:00
|
|
|
if [ $ygginitCount = false ]; then
|
2018-05-30 11:15:57 +00:00
|
|
|
msg "Initializing"
|
|
|
|
yggInit
|
|
|
|
msg "Updating the system"
|
|
|
|
updateSystem
|
2018-06-05 12:21:47 +00:00
|
|
|
ygginitCount=true
|
2018-05-30 11:15:57 +00:00
|
|
|
fi
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Installing TLP"
|
2018-06-12 11:39:46 +00:00
|
|
|
installAppsFromList tlp
|
2018-03-24 16:20:26 +00:00
|
|
|
;;
|
2019-07-10 20:50:00 +00:00
|
|
|
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
|
|
|
|
;;
|
2018-01-03 21:59:50 +00:00
|
|
|
u)
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Initializing"
|
2018-03-14 18:34:00 +00:00
|
|
|
yggInit
|
2018-05-27 14:32:39 +00:00
|
|
|
msg "Updating the system"
|
2018-01-03 21:59:50 +00:00
|
|
|
updateSystem
|
|
|
|
exit
|
|
|
|
;;
|
2018-03-30 07:39:12 +00:00
|
|
|
p)
|
2020-05-24 18:16:08 +00:00
|
|
|
msg "Removing useless dependencies"
|
2018-03-30 07:39:12 +00:00
|
|
|
toolAutoremove
|
|
|
|
exit
|
|
|
|
;;
|
2017-12-29 10:46:53 +00:00
|
|
|
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
|
|
|
|
|
2018-05-30 11:15:57 +00:00
|
|
|
# if CLI mode, no need to run the menus...
|
|
|
|
[[ $# -gt 0 ]] && exit
|
|
|
|
|
2017-12-30 22:08:45 +00:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Menu Mode #
|
|
|
|
#-----------------------------------------------------------------------------#
|
2017-12-29 10:46:53 +00:00
|
|
|
|
2018-03-22 10:14:26 +00:00
|
|
|
# show Yggdrasil logo
|
2017-12-30 21:12:24 +00:00
|
|
|
dispLogo
|
2017-12-29 10:46:53 +00:00
|
|
|
|
2018-03-22 10:14:26 +00:00
|
|
|
# show system informations
|
2018-03-22 09:51:16 +00:00
|
|
|
dispSysInfos
|
2017-12-27 13:54:15 +00:00
|
|
|
|
2017-12-28 18:27:44 +00:00
|
|
|
# Useless by itself, but is used to don't be annoyed later in the script
|
2017-12-27 13:54:15 +00:00
|
|
|
sudo echo
|
|
|
|
|
2018-03-14 18:39:12 +00:00
|
|
|
# init, check and install/update dependencies
|
2018-03-14 18:34:00 +00:00
|
|
|
yggInit
|
|
|
|
|
2017-12-27 13:54:15 +00:00
|
|
|
pressKey
|
|
|
|
|
|
|
|
# Apps dir created if necessary
|
|
|
|
mkdir -p /home/$myHomedir/Apps
|
|
|
|
|
2017-12-30 22:08:45 +00:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Main menu #
|
|
|
|
#-----------------------------------------------------------------------------#
|
2017-12-27 13:54:15 +00:00
|
|
|
|
|
|
|
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" \
|
2018-05-02 01:11:25 +00:00
|
|
|
"2" "Applications" \
|
2020-04-25 20:34:11 +00:00
|
|
|
"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)
|
2017-12-27 13:54:15 +00:00
|
|
|
|
|
|
|
case $mainMenuOptions in
|
|
|
|
"1")
|
|
|
|
updateSystem
|
|
|
|
pressKey
|
|
|
|
;;
|
|
|
|
"2")
|
|
|
|
showAppInstallMenu
|
|
|
|
;;
|
2018-05-02 01:11:25 +00:00
|
|
|
"3")
|
2017-12-27 13:54:15 +00:00
|
|
|
showThemesInstallMenu
|
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"4")
|
2017-12-27 13:54:15 +00:00
|
|
|
showDevInstallMenu
|
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"5")
|
2017-12-27 13:54:15 +00:00
|
|
|
showConfigMenu;
|
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"6")
|
2018-06-08 23:05:02 +00:00
|
|
|
showHardwareMenu
|
2017-12-27 13:54:15 +00:00
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"7")
|
2018-06-08 23:05:02 +00:00
|
|
|
showSysToolsMenu
|
2017-12-27 13:54:15 +00:00
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"8")
|
2018-12-15 22:47:30 +00:00
|
|
|
addRepo_Makoto
|
2017-12-27 13:54:15 +00:00
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"9")
|
2018-12-15 22:47:30 +00:00
|
|
|
showRebootBoxMenu
|
2018-06-08 23:05:02 +00:00
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"10")
|
2018-12-15 22:47:30 +00:00
|
|
|
showAboutBoxMenu
|
|
|
|
;;
|
2020-04-25 20:34:11 +00:00
|
|
|
"11")
|
2017-12-27 13:54:15 +00:00
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac # main menu
|
|
|
|
done # end of main menu loop
|
|
|
|
|
|
|
|
clear
|
2018-05-29 11:02:06 +00:00
|
|
|
exit
|