From 2597a9dd6b84c0ad3faaf2f52354deb697e9739b Mon Sep 17 00:00:00 2001 From: Francois B Date: Sat, 26 May 2018 23:25:15 +0200 Subject: [PATCH] functions in external files splited in 16.04 and 18.04 versions to prepare next steps --- core_functions.sh => core_functions_ub1604.sh | 0 core_functions_ub1804.sh | 655 ++++++++ ...unctions.sh => install_functions_ub1604.sh | 0 install_functions_ub1804.sh | 900 +++++++++++ ..._functions.sh => menus_functions_ub1604.sh | 0 menus_functions_ub1804.sh | 475 ++++++ repo_functions.sh => repo_functions_ub1604.sh | 0 repo_functions_ub1804.sh | 1319 +++++++++++++++++ ..._functions.sh => tools_functions_ub1604.sh | 0 tools_functions_ub1804.sh | 145 ++ yggdrasil.sh | 22 +- 11 files changed, 3511 insertions(+), 5 deletions(-) rename core_functions.sh => core_functions_ub1604.sh (100%) create mode 100644 core_functions_ub1804.sh rename install_functions.sh => install_functions_ub1604.sh (100%) create mode 100644 install_functions_ub1804.sh rename menus_functions.sh => menus_functions_ub1604.sh (100%) create mode 100644 menus_functions_ub1804.sh rename repo_functions.sh => repo_functions_ub1604.sh (100%) create mode 100644 repo_functions_ub1804.sh rename tools_functions.sh => tools_functions_ub1604.sh (100%) create mode 100644 tools_functions_ub1804.sh diff --git a/core_functions.sh b/core_functions_ub1604.sh similarity index 100% rename from core_functions.sh rename to core_functions_ub1604.sh diff --git a/core_functions_ub1804.sh b/core_functions_ub1804.sh new file mode 100644 index 0000000..1c54fbc --- /dev/null +++ b/core_functions_ub1804.sh @@ -0,0 +1,655 @@ +#------------------------------------------------------------------------------# +# Yggdrasil NG # +# compatibility : Mint 18, Ubuntu 16.04, Elementary and other derivatives # +# author : Francois B. (Makotosan/Shakasan) # +# licence : GPLv3 # +# website : https://makotonoblog.be/ # +#------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------# +# core functions # +#------------------------------------------------------------------------------# + +# +# display a simple message + CR +# +function smsgn () { + printf "$*\n" +} + +# +# display a simple message +# +function smsg () { + printf "$*" +} + +# +# display a message + notification +# +function msg () { + printf "\n" + printf $JAUNE + if [ "$#" -gt "0" ]; then + printf "$*\n" + /usr/bin/notify-send -t 7000 "$*" + fi + printf $NORMAL +} + +# +# display a message between [ ] depending of the ret_code +# +function retCode () { + typeset ret_code="$1" + if [ $ret_code == 0 ]; then + printf "[ "$BOLDVERT"OK"$NORMAL" ] " + else + printf "[ "$BOLDROUGE"!!"$NORMAL" ] " + fi + printf "\n" +} + +# +# run a shell command and display a message between [ ] depending on the ret_code +# +function runCmd () { + typeset cmd="$1" + typeset txt="$2" + typeset ret_code + + printf "[CMD] $txt " + printf "\n[CMD] $txt : $cmd\n" &>> $logFile + eval $cmd" &>> $logFile" + ret_code=$? + retCode $ret_code +} + +# +# display a message + notification + ask to push a key to continue +# +function pressKey () { + printf "$*\n" + if which mpg123 >/dev/null; then + mpg123 -q /opt/yggdrasil/notify.mp3 & + fi + printf $INV + read -p "Press key to continue ..." + printf $NORMAL +} + +# +# check if OS is Mint +# +function isMint () { + OS=`lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}'` + if [[ $OS == *"Linux Mint 18"* ]]; then + return 0 + else + return 1 + fi +} + +# +# check if DE is Mate +# +function isMate () { + if [[ $DESKTOP_SESSION == *"mate"* ]]; then + return 0 + else + return 1 + fi +} + +# +# check and install required dependencies for Yggdrasil +# +function yggInit () { + typeset ret_code + + printf "[INIT]" + runCmd "echo sience-config science-config/group select '$myHomedir ($myHomedir)' | sudo debconf-set-selections" \ + "apply settings for science-config pkg" + + if ! dpkg --print-foreign-architectures | grep -qi i386; then + printf "[INIT]" + runCmd "sudo dpkg --add-architecture i386" \ + "adding i386 architecture" + else + printf "[INIT] i386 architecture already added [ "$BOLDVERT"OK"$NORMAL" ] \n" + fi + + printf "[INIT]" + addPPA ppa:ubuntu-desktop/ubuntu-make + + printf "[INIT][APT] update " + printf "\n[INIT][APT] update\n" &>> $logFile + sudo apt-get update &>> $logFile + ret_code=$? + retCode $ret_code + + printf "[INIT]" + installPackage apt "apt-transport-https" + + if ! which umake >/dev/null; then + printf "[INIT][UMAKE] not found, installing...\n" + printf "\n[INIT][UMAKE] not found, installing...\n" &>> $logFile + installPackage apt "ubuntu-make" + else + printf "[INIT][UMAKE] found [ "$BOLDVERT"OK"$NORMAL" ] \n" + fi + + if ! which gem >/dev/null; then + printf "[INIT][GEM] not found, installing...\n" + printf "\n[INIT][GEM] not found, installing...\n" &>> $logFile + installPackage apt "ruby-dev" + else + printf "[INIT][GEM] found [ "$BOLDVERT"OK"$NORMAL" ] \n" + fi + + if ! which snap >/dev/null; then + printf "[INIT][SNAP] not found, installing...\n" + printf "\n[INIT][SNAP] not found, installing...\n" &>> $logFile + installPackage apt "snapd" + else + printf "[INIT][SNAP] found [ "$BOLDVERT"OK"$NORMAL" ] \n" + fi + + if ! which npm >/dev/null; then + printf "[INIT][NPM] not found, installing...\n" + printf "\n[INIT][NPM] not found, installing...\n" &>> $logFile + installPackage apt "nodejs" + else + printf "[INIT][NPM] found [ "$BOLDVERT"OK"$NORMAL" ] \n" + fi + + if ! which pip3 >/dev/null; then + printf "[INIT][PIP] not found, installing...\n" + printf "\n[INIT][PIP] not found, installing...\n" &>> $logFile + printf "[INIT]" + installPackage apt "python3-pip" + printf "[INIT]" + installPackage pip "pip" + printf "[INIT]" + installPackage pip "setuptools" + else + printf "[INIT][PIP] found [ "$BOLDVERT"OK"$NORMAL" ] \n" + printf "[INIT]" + installPackage pip "pip" + printf "[INIT]" + installPackage pip "setuptools" + fi +} + +# +# update kernel to the latest version +# +function kernelUpdate () { + checkAndInstallDep apt ukuu ukuu \ + && runCmd "sudo ukuu --install-latest --yes" \ + "installing latest kernel" +} + +# +# system update +#TODO: add pip, npm (yarn?), gem +# +function updateSystem () { + typeset ret_code + + printf "[APT] update " + printf "\n[APT] update\n" &>> $logFile + sudo apt-get update &>> $logFile + ret_code=$? + retCode $ret_code + + printf "[APT] upgrade " + printf "\n[APT] upgrade\n" &>> $logFile + sudo apt-get -y upgrade &>> $logFile + ret_code=$? + retCode $ret_code + + printf "[APT] dist-upgrade " + printf "\n[APT] dist-upgrade\n" &>> $logFile + sudo apt-get -y dist-upgrade &>> $logFile + ret_code=$? + retCode $ret_code + + if which snap >/dev/null; then + printf "[SNAP] refresh " + printf "\n[SNAP] refresh\n" &>> $logFile + sudo snap refresh &>> $logFile + ret_code=$? + retCode $ret_code + fi + + repoAdded=0 +} + +# +# add ppa +# input : ppa name +# +function addPPA () { + typeset ret_code + + prefix="ppa:" + str="$*" + str2search=${str#$prefix} + + if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -q ${str2search}; then + printf "[PPA] adding : $* " + printf "\n[PPA] adding $*\n" &>> $logFile + sudo add-apt-repository -y $* &>> $logFile + ret_code=$? + retCode $ret_code + else + printf "[PPA] PPA already added [ "$BOLDVERT"OK"$NORMAL" ] \n" + fi +} + +# +# add repo's key +# input : file's url OR keyserver + key +# +function addKey () { + typeset ret_code + + case $# in + "1") + printf "[REPO] adding key from file : $1 " + printf "\n[REPO] adding key from file $1\n" &>> $logFile + wget -qO - $1 | sudo apt-key add - &>> $logFile + ret_code=$? + retCode $ret_code + ;; + "2") + printf "[REPO] adding key $2 from $1 " + printf "\n[REPO] adding key $2 from $1\n" &>> $logFile + gpg --keyserver $1 --recv-keys $2 &>> $logFile \ + && gpg -a --export $2 | sudo apt-key add - &>> $logFile + ret_code=$? + retCode $ret_code + ;; + esac +} + +# +# create new entry in /etc/apt/source.list.d/ +# input : filename, repo, src repo +# +function addRepo () { + typeset ret_code + printf "[REPO] adding : $2 in $1 " + printf "\n[REPO] adding $2 in $1\n" &>> $logFile + echo $2 | sudo tee /etc/apt/sources.list.d/$1 &>> $logFile + ret_code=$? + retCode $ret_code + if [ "$#" -eq 3 ]; then + printf "[REPO] adding : $3 in $1 " + printf "\n[REPO] adding $3 in $1\n" &>> $logFile + echo $3 | sudo tee -a /etc/apt/sources.list.d/$1 &>> $logFile + ret_code=$? + retCode $ret_code + fi +} + +# +# install package manually +# input : url of package, package name, menu mode +# +function installPackageDpkg () { + printf "[PKG] Installing $2 from $1 " + printf "\n[PKG] installing $2 from $1\n" &>> $logFile + cd /tmp \ + && wget -q -O $2 $1 &>> $logFile \ + && sudo dpkg -i $2 &>> $logFile + sudo apt-get install -fy &>> $logFile + ret_code=$? + retCode $ret_code + if [ "$3" == "yes" ]; then + pressKey + fi +} + +# +# install package from repositories +# input : package manager, package name +# package manager available : apt, pip, npm, gem, snap +# TODO: add apm, flatpak, umake?, use yarn instead of npm ? +# +function installPackage () { + typeset pkg="$2" + typeset ret_code + + case $1 in + "apt") + printf "[APT] Installing $pkg " + printf "\n[APT] installing $pkg\n" &>> $logFile + sudo apt-get install -fy $pkg &>> $logFile + ret_code=$? + retCode $ret_code + ;; + "pip") + if which pip3 >/dev/null; then + printf "[PIP] Installing $pkg " + printf "\n[PIP] installing $pkg\n" &>> $logFile + sudo -H pip3 install --upgrade $pkg &>> $logFile + ret_code=$? + retCode $ret_code + fi + ;; + "npm") + if which npm >/dev/null; then + printf "[NPM] Installing $pkg " + printf "\n[NPM] installing $pkg\n" &>> $logFile + sudo npm install -g $pkg &>> $logFile + ret_code=$? + retCode $ret_code + fi + ;; + "gem") + if which gem >/dev/null; then + printf "[GEM] Installing $pkg " + printf "\n[GEM] installing $pkg\n" &>> $logFile + sudo gem install $pkg &>> $logFile + ret_code=$? + retCode $ret_code + fi + ;; + "snap") + if which snap >/dev/null; then + printf "[SNAP] Installing $pkg " + printf "\n[SNAP] installing $pkg\n" &>> $logFile + sudo snap install $pkg --classic &>> $logFile + ret_code=$? + retCode $ret_code + fi + ;; + esac +} + +# +# check dependency and install it if necessary +# input : package manager, package name, cmd/bin to check +# +function checkAndInstallDep () { + if ! which $3 >/dev/null; then + printf "[DEP] dependency $2 not found [ "$BOLDROUGE"!!"$NORMAL" ]\n" + printf "[DEP] dependency $2 not found\n" &>> $logFile + case $1 in + "apt") + installPackage apt $2 + ;; + "npm") + installPackage npm $2 + ;; + "pip") + installPackage pip $2 + ;; + "gem") + installPackage gem $2 + ;; + "snap") + installPackage snap $2 + ;; + esac + fi +} + +# +# add specific repository for a given package +# input : unique ID, apt cache update yes/no +# +function addSpecificRepoFct () { + for i in $AppsRepo; do + appRepo=(${i//;/ }) + if [ "${appRepo[0]}" == "$1" ]; then + printf "[ADD] package -- $1 -- repo/ppa " + printf "added by function -- ${appRepo[1]}\n" + eval "${appRepo[1]}" + repoAdded=$(($repoAdded+1)) + fi + done + if [ "$2" == "yes" ]; then + updateSystem + fi + unset i + unset appRepo +} + +# +# find and execute Pre/Post install functions for a specific app +# input : unique ID +# +function processAppTrtFct () { + for i in $AppsTrtFct; do + appTrtFct=(${i//;/ }) + if [ "${appTrtFct[0]}" == "$1" ]; then + printf "[TRT] package -- $1 -- " + printf "post install processed by -- ${appTrtFct[1]}\n" + eval "${appTrtFct[1]}" + fi + done +} + +# +# install all about a specific category from Apps array app list (headless) +# input : category name +# +function installAppsFromList () { + msg "Installing apps from $1 category" + for i in $Apps; do + app=(${i//;/ }) + if [ "${app[2]}" == "$1" ]; then + addSpecificRepoFct ${app[3]} + fi + done + unset i + unset app + if [ "$repoAdded" -gt "0" ]; then + updateSystem + fi + for i in $Apps; do + app=(${i//;/ }) + if [ "${app[2]}" == "$1" ]; then + installPackage ${app[1]} ${app[0]} + processAppTrtFct ${app[3]} + fi + done +} + +# +# generate install apps menu about a specific category from Apps array app list (Menu) +# input : category name +# +function installAppsFromListMenu () { + for i in $Apps; do + app=(${i//;/ }) + if [ "${app[2]}" == "$1" ]; then + list+=("${app[3]}" "${app[3]}" "ON") + fi + done + + pkg=$(whiptail \ + --title "Yggdrasil $version - App Install ($1)" \ + --checklist \ + "Select app to install and press OK" 25 80 19 \ + "${list[@]}" 3>&1 1>&2 2>&3) + + exitstatus=$? + if [ $exitstatus = 0 ]; then + for pkgToInstall in $pkg; do + for i in $Apps; do + app=(${i//;/ }) + if [ "${app[3]}" == "${pkgToInstall//\"}" ]; then + addSpecificRepoFct ${app[3]} + fi + done + done + unset i + unset app + unset pkgToInstall + if [ "$repoAdded" -gt "0" ]; then + updateSystem + fi + for pkgToInstall in $pkg; do + for i in $Apps; do + app=(${i//;/ }) + if [ "${app[3]}" == "${pkgToInstall//\"}" ]; then + installPackage ${app[1]} ${app[0]} + processAppTrtFct ${app[3]} + fi + done + done + fi + unset list + pressKey +} + +# +# create app shortcut +# inputs : bin to exec, icon path, category, name, local/global, start w/ session +# +function createAppShortcut () { + typeset ret_code + + shortcut='[Desktop Entry]\n' + shortcut+='Encoding=UTF-8\n' + shortcut+='Terminal=0\n' + shortcut+='Exec='$1'\n' + shortcut+='Icon='$2'\n' + shortcut+='Type=Application\n' + if [ "$6" == "start" ]; then + shortcut+='X-MATE-Autostart-enabled=true\n\n' + else + shortcut+='Categories='$3';\n' + fi + shortcut+='StartupNotify=true\n' + shortcut+='Name='$4'\n' + shortcut+='GenericName='$4'\n' + shortcut+='Comment=' + + if [ "$5" == "global" ]; then + smsg "creating shortcut for $4 " + echo -e $shortcut > /usr/share/applications/"$4".desktop + ret_code=$? + retCode $ret_code + else + mkdir -p /home/$myHomedir/.local/share/applications + smsg "creating shortcut for $4 " + echo -e $shortcut > /home/"$myHomedir"/.local/share/applications/"$4".desktop + ret_code=$? + retCode $ret_code + fi +} + +# +# show Yggdrasil logo +# +function dispLogo () { + printf "\n" + printf $BOLDJAUNE + printf "██╗ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ █████╗ ███████╗██╗██╗ \n" + printf "╚██╗ ██╔╝██╔════╝ ██╔════╝ ██╔══██╗██╔══██╗██╔══██╗██╔════╝██║██║ \n" + printf " ╚████╔╝ ██║ ███╗██║ ███╗██║ ██║██████╔╝███████║███████╗██║██║ \n" + printf " ╚██╔╝ ██║ ██║██║ ██║██║ ██║██╔══██╗██╔══██║╚════██║██║██║ \n" + printf " ██║ ╚██████╔╝╚██████╔╝██████╔╝██║ ██║██║ ██║███████║██║███████╗\n" + printf " ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝╚══════╝\n" + printf "$BOLDROUGE Customize Linux Mint & Ubuntu derivatives made easier\n" + printf "$BOLDBLANC ver "$version" - GPLv3 - Francois B. (Makotosan) - makotonoblog.be\n" + printf "\n" +} + +# +# show usage for headless mode +# +function usage () { + dispLogo + dispSysInfos + printf "\n" + printf $NORMAL + printf "Usage : yggdrasil [options]\n\n" + printf " "$BOLDVERT"-f"$NORMAL" : install everything (see man pages for more details)(a+c+d+q)\n" + printf " "$BOLDVERT"-a"$NORMAL" : install all apps\n" + printf " "$BOLDVERT"-c"$NORMAL" : install Themes and Icons\n" + printf " "$BOLDVERT"-w"$NORMAL" : install Nitrogen + remove desktop management from caja\n" + printf " "$BOLDVERT"-d"$NORMAL" : install DNS Cache Unbound\n" + printf " "$BOLDVERT"-q"$NORMAL" : install cardreader apps\n" + printf " "$BOLDVERT"-s"$NORMAL" : install Solaar for Logitech Unifying devices\n" + printf " "$BOLDVERT"-t"$NORMAL" : install TLP for Laptops and low energy usage\n" + printf " "$BOLDVERT"-n"$NORMAL" : install lastest Nvidia graphic drivers\n" + printf " "$BOLDVERT"-g"$NORMAL" : install lastest free graphic drivers (nouveau, amdgpu, ati, intel), mesa, ...\n" + printf " "$BOLDVERT"-k"$NORMAL" : update system to the latest kernel\n" + printf " "$BOLDVERT"-u"$NORMAL" : update system (apt,snap,...)\n" + printf " "$BOLDVERT"-p"$NORMAL" : clean useless packages\n" + printf " "$BOLDVERT"-v"$NORMAL" : show verison number\n" + printf " "$BOLDVERT"-h"$NORMAL" : show help & informations\n" + printf "\n" +} + +function dispSysInfos () { + # CPU Architecture + printf $BOLDVERT"Architecture : "$NORMAL + uname -m + + # Current user homedir + printf $BOLDVERT"User (userdir) :"$NORMAL" $myHomedir\n" + + # Linux Distro Name + printf $BOLDVERT"OS : "$NORMAL + lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}' + + # Kernel version + printf $BOLDVERT"Kernel : "$NORMAL + uname -r + + # Desktop Name + printf $BOLDVERT"Desktop : "$NORMAL + case $XDG_CURRENT_DESKTOP in + "ENLIGHTENMENT") + printf "Enlightenment" + printf "\n" + ;; + "GNOME") + printf "Gnome" + printf "\n" + ;; + "KDE") + printf "KDE" + printf "\n" + ;; + "LXDE") + printf "LXDE" + printf "\n" + ;; + "MATE") + printf "Mate" + printf "\n" + ;; + "XFCE") + printf "XFCE" + printf "\n" + ;; + "X-Cinnamon") + printf "Cinnamon" + printf "\n" + ;; + "Unity") + printf "Unity" + printf "\n" + ;; + esac + + # Screen Resolution + printf $BOLDVERT"Screen resolution : "$NORMAL + xdpyinfo | sed -n 's/.*dim.* \([0-9]*x[0-9]*\) .*/\1/pg' | tr '\n' ' ' + printf "\n" + + # Type of Shell + printf $BOLDVERT"Shell : "$NORMAL + shellType=$(ps -p $PPID -o cmd --no-heading) + shellType=${shellType/-} + shellType=${shellType//*\/} + printf $shellType"\n" +} diff --git a/install_functions.sh b/install_functions_ub1604.sh similarity index 100% rename from install_functions.sh rename to install_functions_ub1604.sh diff --git a/install_functions_ub1804.sh b/install_functions_ub1804.sh new file mode 100644 index 0000000..e4abfd5 --- /dev/null +++ b/install_functions_ub1804.sh @@ -0,0 +1,900 @@ +#------------------------------------------------------------------------------# +# Yggdrasil NG # +# compatibility : Mint 18, Ubuntu 16.04, Elementary and other derivatives # +# author : Francois B. (Makotosan/Shakasan) # +# licence : GPLv3 # +# website : https://makotonoblog.be/ # +#------------------------------------------------------------------------------# + +#-----------------------------------------------------------------------------# +# install functions # +#-----------------------------------------------------------------------------# + +# +# install Base Apps (headless) +# +function installBase () { + installAppsFromList base +} + +# +# install Base Apps (Menu) +# +function installBaseMenu () { + installAppsFromListMenu base +} + +# +# install Office Apps (headless) +# +function installOffice () { + installAppsFromList office +} + +# +# install Office Apps (Menu) +# +function installOfficeMenu () { + installAppsFromListMenu office +} + +# +# install Multimedia Apps (headless) +# +function installMultimedia () { + installAppsFromList multimedia +} + +# +# install Multimedia Apps (Menu) +# +function installMultimediaMenu () { + installAppsFromListMenu multimedia +} + +# +# install eBook Apps (headless) +# +function installEbook () { + installAppsFromList ebook +} + +# +# install eBook Apps (Menu) +# +function installEbookMenu () { + installAppsFromListMenu ebook +} + +# +# install Internet Apps (headless) +# +function installInternet () { + runCmd "echo opera-stable opera-stable/add-deb-source boolean false | sudo debconf-set-selections" \ + "setting as do not add repo" + installAppsFromList internet +} + +# +# install Internet Apps (Menu) +# +function installInternetMenu () { + runCmd "echo opera-stable opera-stable/add-deb-source boolean false | sudo debconf-set-selections" \ + "setting as do not add repo" + installAppsFromListMenu internet +} + +# +# Viber (headless) +# +function installViber () { + installPackageDpkg http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb \ + viber.deb \ + no +} + +# +# Viber (Menu) +# +function installViberMenu () { + installPackageDpkg http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb \ + viber.deb \ + yes +} + +# +# Franz (headless) +# +function installFranz () { + installPackageDpkg https://github.com/meetfranz/franz/releases/download/v5.0.0-beta.17/franz_5.0.0-beta.17_amd64.deb \ + franz.deb \ + no +} + +# +# Franz (Menu) +# +function installFranzMenu () { + installPackageDpkg https://github.com/meetfranz/franz/releases/download/v5.0.0-beta.17/franz_5.0.0-beta.17_amd64.deb \ + franz.deb \ + yes +} + +# +# install Misc Utilities Apps (headless) +# +function installMiscUtilities () { + installAppsFromList utilities +} + +# +# install Misc Utilities Apps (Menu) +# +function installMiscUtilitiesMenu () { + installAppsFromListMenu utilities +} + +# +# install Wine Build (headless) +# +function installWine () { + installAppsFromList wine +} + +# +# install Wine Build (Menu) +# +function installWineMenu () { + installAppsFromListMenu wine +} + +# +# install Game Apps (headless) +# +function installGames () { + installAppsFromList games +} + +# +# install Game Apps (Menu) +# +function installGamesMenu () { + installAppsFromListMenu games +} + +# +# Steam (headless) +# +function installSteam () { + runCmd "echo steam steam/purge \"note\" | sudo debconf-set-selections \"accepting steam licence\"" + runCmd "echo steam steam/license \"note\" | sudo debconf-set-selections \"accepting steam licence 2/3\"" + runCmd "echo steam steam/question select \"I AGREE\" | sudo debconf-set-selections \"accepting steam licence 3/3\"" + installPackage apt steam +} + +# +# Steam (Menu) +# +function installSteamMenu () { + installPackage apt steam +} + +# +# install Burning Apps (headless) +# +function installBurningTools () { + installAppsFromList burningtools +} + +# +# install Burning Apps (Menu) +# +function installBurningToolsMenu () { + installAppsFromListMenu burningtools +} + +# +# install Network Apps (headless) +# +function installNetTools () { + runCmd "echo wireshark-common wireshark-common/install-setuid boolean true | sudo debconf-set-selections" \ + "setting Wireshark as root only" + installAppsFromList nettools +} + +# +# install Network Apps (Menu) +# +function installNetToolsMenu () { + runCmd "echo wireshark-common wireshark-common/install-setuid boolean true | sudo debconf-set-selections" \ + "setting Wireshark as root only" + installAppsFromListMenu nettools +} + +# +# install Caja Plugins (headless) +# +function installCajaPlugins () { + installAppsFromList cajaplugins +} + +# +# install Caja Plugins (Menu) +# +function installCajaPluginsMenu () { + installAppsFromListMenu cajaplugins +} + +# +# install Nautilus Apps + plugins (headless) +# +function installNautilusAndPlugins () { + installAppsFromList nautilus +} + +# +# install Nautilus Apps + plugins (Menu) +# +function installNautilusAndPluginsMenu () { + installAppsFromListMenu nautilus +} + +# +# install Gimp plugins (headless) +# +function installGimpPlugins () { + installAppsFromList gimp +} + +# +# install Gimp plugins (Menu) +# +function installGimpPluginsMenu () { + installAppsFromListMenu gimp +} + +# +# install RhythmBox plugins (headless) +# +function installRhythmBoxPlugins () { + installAppsFromList rhythmbox +} + +# +# install RhythmBox plugins (Menu) +# +function installRhythmBoxPluginsMenu () { + installAppsFromListMenu rhythmbox +} + +# +# install Pidgin plugins (headless) +# +function installPidginPlugins () { + installAppsFromList pidgin +} + +# +# install Pidgin plugins (Menu) +# +function installPidginPluginsMenu () { + installAppsFromListMenu pidgin +} + +# +# install Nitrogen app (headless) +# +function installNitrogen () { + installAppsFromList nitrogen +} + +# +# install Nitrogen app (Menu) +# +function installNitrogenMenu () { + installAppsFromListMenu nitrogen +} + +# +# install Beta Apps (headless) +# +function installBeta () { + installAppsFromList beta +} + +# +# install Beta Apps (Menu) +# +function installBetaMenu () { + installAppsFromListMenu beta +} + +# +# install Nightly Apps (headless) +# +function installNightly () { + installAppsFromList nightly +} + +# +# install Nightly Apps (Menu) +# +function installNightlyMenu () { + installAppsFromListMenu nightly +} + +# +# install GTK Themes (headless) +# +function installThemes () { + installAppsFromList gtkthemes +} + +# +# install GTK Themes (Menu) +# +function installThemesMenu () { + installAppsFromListMenu gtkthemes +} + +# +# install Icon Themes (headless) +# +function installIcons () { + installAppsFromList icons +} + +# +# install Icon Themes (Menu) +# +function installIconsMenu () { + installAppsFromListMenu icons +} + +# +# install Solaar App (headless) +# +function installSolaar () { + installAppsFromList solaar +} + +# +# install Solaar App (Menu) +# +function installSolaarMenu () { + installAppsFromListMenu solaar +} + +# +# install CardReader Apps (headless) +# +function installCardReader () { + installAppsFromList cardreader +} + +# +# install CardReader Apps (Menu) +# +function installCardReaderMenu () { + installAppsFromListMenu cardreader +} + +# +# update AMD/Intel CPU Microcode +# +function updateMicrocode () { + msg "CPU Microcode updating" + oldMicrocode=`cat /proc/cpuinfo | grep -i --color microcode -m 1` + intel=`cat /proc/cpuinfo | grep -i Intel | wc -l` + amd=`cat /proc/cpuinfo | grep -i Amd | wc -l` + if [ "$intel" -gt "0" ]; then + printf "[INFO] Microcode updated from "$oldMicrocode" version to "$newMicrocode" version" + installPackage apt intel-microcode + elif [ "$amd" -gt "0" ]; then + installPackage apt amd64-microcode + printf "[INFO] Microcode updated from "$oldMicrocode" version to "$newMicrocode" version" + else + printf "[INFO] No Intel/AMD CPU found" + fi + newMicrocode=`cat /proc/cpuinfo | grep -i --color microcode -m 1` + printf "\n" +} + +# +# fix some config issue with Intel Wireless 6320 cards +# +function fixWirelessIntel6320 () { + runCmd "sudo cp /etc/modprobe.d/iwlwifi.conf /etc/modprobe.d/iwlwifi.conf.bak" \ + "backing up config file" + runCmd "echo options iwlwifi bt_coex_active=0 swcrypto=1 11n_disable=8 | sudo tee /etc/modprobe.d/iwlwifi.conf" \ + "applying new config" + printf "[INFO] reboot required !!!" + printf "\n" +} + +# +# install Webcam Apps (headless) +# +function installWebcam () { + installAppsFromList webcam +} + +# +# install Webcam Apps (Menu) +# +function installWebcamMenu () { + installAppsFromListMenu webcam +} + +# +# install latest versions of graphic drivers, mesa, .... (headless) +# +function installOibaf () { + addRepo_Oibaf +} + +# +# install latest versions of graphic drivers, mesa, .... (Menu) +# +function installOibafMenu () { + addRepo_Oibaf +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia370 () { + installAppsFromList nvidia-370 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia370Menu () { + installAppsFromListMenu nvidia-370 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia375 () { + installAppsFromList nvidia-375 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia375Menu () { + installAppsFromListMenu nvidia-375 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia378 () { + installAppsFromList nvidia-378 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia378Menu () { + installAppsFromListMenu nvidia-378 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia381 () { + installAppsFromList nvidia-381 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia381Menu () { + installAppsFromListMenu nvidia-381 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia384 () { + installAppsFromList nvidia-384 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia384Menu () { + installAppsFromListMenu nvidia-384 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia387 () { + installAppsFromList nvidia-387 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia387Menu () { + installAppsFromListMenu nvidia-387 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia390 () { + installAppsFromList nvidia-390 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia390Menu () { + installAppsFromListMenu nvidia-390 +} + +# +# install Nvidia Drivers (headless) +# +function installNvidia396 () { + installAppsFromList nvidia-396 +} + +# +# install Nvidia Drivers (Menu) +# +function installNvidia396Menu () { + installAppsFromListMenu nvidia-396 +} + +# +# install TLP App (headless) +# +function installTLP () { + installAppsFromList tlp +} + +# +# install TLP App (Menu) +# +function installTLPMenu () { + installAppsFromListMenu tlp +} + +#TODO: +function installKeyIDuDev () { + sudo sh -c "echo '# this udev file should be used with udev 188 and newer\n\ +ACTION!=\"add|change\", GOTO=\"u2f_end\"\n\ +\n\ +# Key-ID FIDO U2F\n\ +KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"096e\", ATTRS{idProduct}==\"0850|0880\", TAG+=\"uaccess\"\n\ +\n\ +LABEL=\"u2f_end\"' > /etc/udev/rules.d/70-u2f.rules" + + runCmd "sudo service udev restart" \ + "restarting UDEV service" +} + +# +# install Dev Apps (headless) +# +function installDevApps () { + installAppsFromList dev +} + +# +# install Dev Apps (Menu) +# +function installDevAppsMenu () { + installAppsFromListMenu dev +} + + +# +# install Javascript env (headless) +# +function installJavascript () { + installAppsFromList javascript +} + +# +# install Javascript env (Menu) +# +function installJavascriptMenu () { + installAppsFromListMenu javascript +} + +# +# install JAVA 10 (headless) +# +function installJava10 () { + runCmd "echo oracle-java10-installer shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections" \ + "accepting Oracle Java SE 10 licence agreement" + installAppsFromList java10 +} + +# +# install JAVA 10 (Menu) +# +function installJava10Menu () { + runCmd "echo oracle-java10-installer shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections" \ + "accepting Oracle Java SE 10 licence agreement" + installAppsFromListMenu java10 +} + +# +# install Mongo DB 3 CE (headless) +# +function installMongo3CE () { + installAppsFromList mongodb +} + +# +# install Mongo DB 3 CE (Menu) +# +function installMongo3CEMenu () { + installAppsFromListMenu mongodb +} + +# +# install Python Apps (headless) +# +function installPython () { + installAppsFromList python +} + +# +# install Python Apps (Menu) +# +function installPythonMenu () { + installAppsFromListMenu python +} + +# +# install PHP Apps (headless) +# +function installPHP () { + installAppsFromList php +} + +# +# install PHP Apps (Menu) +# +function installPHPMenu () { + installAppsFromListMenu php +} + +# +# install QT Apps/tools (headless) +# +function installQT () { + installAppsFromList qt +} + +# +# install QT Apps/tools (Menu) +# +function installQTMenu () { + installAppsFromListMenu qt +} + +# +# install LUA Apps (headless) +# +function installLUA () { + installAppsFromList lua +} + +# +# install LUA Apps (Menu) +# +function installLUAMenu () { + installAppsFromListMenu lua +} + +# +# install Ruby Apps (headless) +# +function installRuby () { + installAppsFromList ruby +} + +# +# install Ruby Apps (Menu) +# +function installRubyMenu () { + installAppsFromListMenu ruby +} + +#TODO: +function installAndroidEnv () { + msg="Installing Android environment" + + runCmd "touch /home/$myHomedir/.bashrc" \ + "creating .bashrc file if necessary" + sh -c "echo '\n\nexport PATH=${PATH}:/home/'$myHomedir'/Android/Sdk/tools:/home/'$myHomedir'/Android/Sdk/platform-tools' >> /home/$myHomedir/.bashrc" +} + +# +# install Atom App (headless) +# +function installAtom () { + installAppsFromList atom +} + +# +# install Atom App (menu) +# +function installAtomMenu () { + installAppsFromListMenu atom +} + +# +# install Anjuta Apps (headless) +# +function installAnjuta () { + installAppsFromList anjuta +} + +# +# install Anjuta Apps (Menu) +# +function installAnjutaMenu () { + installAppsFromListMenu anjuta +} + +# +# install Brackets Apps (headless) +# +function installBrackets () { + installAppsFromList brackets +} + +# +# install Brackets Apps (Menu) +# +function installBracketsMenu () { + installAppsFromListMenu brackets +} + +# +# install CodeBlocks Apps (headless) +# +function installCodeBlocks () { + installAppsFromList codeblocks +} + +# +# install CodeBlocks Apps (Menu) +# +function installCodeBlocksMenu () { + installAppsFromListMenu codeblocks +} + +# +# install Geany Apps (headless) +# +function installGeany () { + installAppsFromList geany +} + +# +# install Geany Apps (Menu) +# +function installGeanyMenu () { + installAppsFromListMenu geany +} + +# +# install IDEA Apps (headless) +# +function installIdea () { + installAppsFromList idea +} + +# +# install IDEA Apps (Menu) +# +function installIdeaMenu () { + installAppsFromListMenu idea +} + +# +# install Pycharm Apps (headless) +# +function installPyCharm () { + installAppsFromList pycharm +} + +# +# install Pycharm Apps (Menu) +# +function installPyCharmMenu () { + installAppsFromListMenu pycharm +} + +# +# install Visual Studio Code Apps (headless) +# +function installVisualStudioCode () { + installAppsFromList code +} + +# +# install Visual Studio Code Apps (Menu) +# +function installVisualStudioCodeMenu () { + installAppsFromListMenu code +} + +# +# install Android-Studio Apps (headless) +# +function installAndroidStudio () { + installAppsFromList androidstudio +} + +# +# install Android-Studio Apps (Menu) +# +function installAndroidStudioMenu () { + installAppsFromListMenu androidstudio +} + +# +# install SublimeText Apps (headless) +# +function installSublimeText() { + installAppsFromList sublime-text +} + +# +# install SublimeText Apps (Menu) +# +function installSublimeTextMenu() { + installAppsFromListMenu sublime-text +} + +# +# install CAD Apps (headless) +# +function installCAD () { + installAppsFromList cad +} + +# +# install CAD Apps (Menu) +# +function installCADMenu () { + installAppsFromListMenu cad +} + +# +# install Teamviewer 13 (headless) +# +function installTeamViewer13 () { + installPackageDpkg https://download.teamviewer.com/download/linux/teamviewer_amd64.deb \ + teamviewer13.deb \ + no +} + +# +# install Teamviewer 13 (Menu) +# +function installTeamViewer13Menu () { + installPackageDpkg https://download.teamviewer.com/download/linux/teamviewer_amd64.deb \ + teamviewer13.deb \ + yes +} + +# +# install/enable Unboud (headless) +# +function installUnbound () { + installAppsFromList unbound +} diff --git a/menus_functions.sh b/menus_functions_ub1604.sh similarity index 100% rename from menus_functions.sh rename to menus_functions_ub1604.sh diff --git a/menus_functions_ub1804.sh b/menus_functions_ub1804.sh new file mode 100644 index 0000000..3eb1ec2 --- /dev/null +++ b/menus_functions_ub1804.sh @@ -0,0 +1,475 @@ +#------------------------------------------------------------------------------# +# Yggdrasil NG # +# compatibility : Mint 18, Ubuntu 16.04, Elementary and other derivatives # +# author : Francois B. (Makotosan/Shakasan) # +# licence : GPLv3 # +# website : https://makotonoblog.be/ # +#------------------------------------------------------------------------------# + +#-----------------------------------------------------------------------------# +# menus functions # +#-----------------------------------------------------------------------------# + +# +# show about dialog box +# +function showAboutBoxMenu () { +whiptail \ +--title "About" \ +--msgbox "\n + Author : Francois B. (Makotosan) + Email : shakasan@sirenacorp.be +Website : https://makotonoblog.be/ + Github : https://github.com/shakasan/yggdrasil_ng +Licence : GPLv3 +Version : $version\n +At the beginning, this script has been written to makes my life easier when I have to (re)install my personal computers ;-) +Advices and remarks are welcome ^^" \ +20 80 +} + +# +# show reboot menu +# +function showRebootBoxMenu () { + if (whiptail \ + --title "Yggdrasil $version - WARNING - ReBoot" \ + --yesno "Are you sure to reboot this computer ?" \ + 7 42) then + sudo reboot + fi +} + +# +# show menu to config system +# +function showConfigMenu () { + while true; do + + configMenuOptions=$(whiptail \ + --title "Yggdrasil $version - System Config" \ + --menu "System Config" \ + 25 80 16 \ + "Ufw" "Enable Firewall (ufw)" \ + "NumLockX" "NumLock Enabled at boot time" \ + "TmpRAM" "/tmp stored in RAM" \ + "screenfetch" "screenfetch added to .bashrc" \ + "historyTS" "TimeStamp enabled in Shell History" \ + "unattendedUpgrades" "Enable automatic security updates" \ + "Unbound" "Enable Unbound DNS Cache server" \ + "Back" "Back" 3>&1 1>&2 2>&3) + + case $configMenuOptions in + "Ufw") + clear + enableUFW + pressKey + ;; + "NumLockX") + clear + enableNumLockX + pressKey + ;; + "TmpRAM") + clear + enableTmpRAM + pressKey + ;; + "screenfetch") + clear + addScreenfetchBashrc + pressKey + ;; + "historyTS") + clear + enableHistoryTS + pressKey + ;; + "unattendedUpgrades") + clear + installUnattendedUpgrades + pressKey + ;; + "Unbound") + clear + installUnbound + pressKey + ;; + "Back") + break + ;; + esac + + done +} + +# +# show menu to install system tools +# +function showSysToolsMenu () { + while true; do + + sysToolsMenuOptions=$(whiptail \ + --title "Yggdrasil $version - System Tools" \ + --menu "System tools to diagnose and optimize" \ + 25 80 16 \ + "inxi" "System informations" \ + "speedtest-cli" "Bandwidth test" \ + "packetloss" "Packetloss test (ping)" \ + "OptimizeFirefox" "Firefox SQLite databases optimization" \ + "Autoremove" "Remove useless Deb packages" \ + "CleanOldKernels" "Removing old kernels (keep 2 last kernels)" \ + "SoundCardsDetection" "Sound Cards Detection" \ + "Back" "Back" 3>&1 1>&2 2>&3) + + case $sysToolsMenuOptions in + "inxi") + clear; toolInxi; pressKey + ;; + "speedtest-cli") + clear; toolSpeedtestCli; pressKey + ;; + "packetloss") + clear; toolPacketLoss; pressKey + ;; + "OptimizeFirefox") + clear; toolOptimizeFirefox; pressKey + ;; + "Autoremove") + clear; toolAutoremove; pressKey + ;; + "CleanOldKernels") + clear; toolClearOldKernels; pressKey + ;; + "SoundCardsDetection") + clear; toolSoundCardsDetection; pressKey + ;; + "Back") + break + ;; + esac + + done +} + +# +# show menu to install themes/icons +# +function showThemesInstallMenu () { + while true; do + + themesInstallMenuOptions=$(whiptail \ + --title "Yggdrasil $version - Themes/Icons Install" \ + --menu "Install themes/icons from different submenus" \ + 25 80 16 \ + "themes" "GTK themes" \ + "icons" "Icons" \ + "Back" "Back" 3>&1 1>&2 2>&3) + + case $themesInstallMenuOptions in + "themes") + installThemesMenu + ;; + "icons") + installIconsMenu + ;; + "Back") + break + ;; + esac + + done +} + +# +# show menu to install dev apps +# +function showDevInstallMenu () { + while true; do + + devInstallMenuOptions=$(whiptail \ + --title "Yggdrasil $version - Dev Install" \ + --menu "Install Dev apps from different submenus" \ + 25 80 16 \ + "devbase" "dev apps and tools" \ + "java10" "Java 10 dev env" \ + "javascript" "JavaScript dev env" \ + "mongodb3ce" "MongoDB 3 CE" \ + "php" "PHP dev env" \ + "lua" "Lua dev env" \ + "ruby" "Ruby dev env" \ + "qt" "QT dev env" \ + "python" "Python dev env" \ + "atom" "Atom" \ + "anjuta" "Anjuta" \ + "brackets" "Brackets" \ + "codeblocks" "CodeBlocks" \ + "geany" "Geany" \ + "idea" "Idea" \ + "pycharm" "PyCharm" \ + "vsc" "Visual Studio Code" \ + "androidstudio" "Android Studio" \ + "sublimetext" "Sublime Text" \ + "cad" "CAD tools" \ + "teamviewer13" "Teamviewer 13" \ + "Back" "Back" 3>&1 1>&2 2>&3) + + case $devInstallMenuOptions in + "devbase") + installDevAppsMenu + ;; + "java10") + installJava10 + ;; + "javascript") + installJavascriptMenu + ;; + "mongodb3ce") + installMongo3CEMenu + ;; + "php") + installPHPMenu + ;; + "lua") + installLUAMenu + ;; + "ruby") + installRubyMenu + ;; + "qt") + installQTMenu + ;; + "python") + installPythonMenu + ;; + "atom") + installAtomMenu + ;; + "anjuta") + installAnjutaMenu + ;; + "brackets") + installBracketsMenu + ;; + "codeblocks") + installCodeBlocksMenu + ;; + "geany") + installGeanyMenu + ;; + "idea") + installIdeaMenu + ;; + "pycharm") + installPyCharmMenu + ;; + "vsc") + installVisualStudioCodeMenu + ;; + "androidstudio") + installAndroidStudioMenu + ;; + "sublimetext") + installSublimeTextMenu + ;; + "cad") + installCADMenu + ;; + "teamviewer13") + installTeamViewer13Menu + ;; + "Back") + break + ;; + esac + + done +} + +# +# show menu to install apps from different categories +# +function showAppInstallMenu () { + while true; do + + appsInstallMenuOptions=$(whiptail \ + --title "Yggdrasil $version - Apps Install" \ + --menu "Install apps from different submenus" \ + 25 80 16 \ + "base" "Base Apps" \ + "office" "Office Apps" \ + "multimedia" "Multimedia Apps" \ + "internet" "Internet Apps" \ + "utilities" "Misc Utilities" \ + "games" "Games & tools" \ + "steam" "Steam" \ + "burningtools" "Disc Burning and tools" \ + "nettools" "Network tools" \ + "cajaplugins" "Caja Plugins" \ + "nautilus" "Nautilus and plugins" \ + "gimp" "Gimp plugins" \ + "rhythmbox" "RhythmBox plugins" \ + "pidgin" "Pidgin plugins" \ + "nitrogen" "Nitrogen WP Manager" \ + "wine" "Wine Builds" \ + "viber" "Viber IM desktop app" \ + "Back" "Back" 3>&1 1>&2 2>&3) + + case $appsInstallMenuOptions in + "base") + installBaseMenu + ;; + "office") + installOfficeMenu + ;; + "multimedia") + installMultimediaMenu + ;; + "internet") + installInternetMenu + ;; + "utilities") + installMiscUtilitiesMenu + ;; + "games") + installGamesMenu + ;; + "steam") + installSteamMenu + ;; + "burningtools") + installBurningToolsMenu + ;; + "nettools") + installNetToolsMenu + ;; + "cajaplugins") + installCajaPluginsMenu + ;; + "nautilus") + installNautilusAndPluginsMenu + ;; + "gimp") + installGimpPluginsMenu + ;; + "rhythmbox") + installRhythmBoxPluginsMenu + ;; + "pidgin") + installPidginPluginsMenu + ;; + "nitrogen") + installNitrogenMenu + ;; + "wine") + installWineMenu + ;; + "viber") + installViberMenu + ;; + "Back") + break + ;; + esac + + done +} + +# +# show menu to install beta apps from different categories +# +function showAppBetaInstallMenu () { + installBetaMenu +} + +# +# show menu to install nightly apps from different categories +# +function showAppNightlyInstallMenu () { + installNightlyMenu +} + +# +# show menu about install/config hardware +# +function showHardwareMenu () { + while true; do + + hardwareMenuOptions=$(whiptail \ + --title "Yggdrasil $version - System Tools" \ + --menu "System tools to diagnose and optimize" \ + 25 80 16 \ + "cardreader" "Apps/tools needed for cardreaders" \ + "solaar" "Solaar for Logitech Unifying devices" \ + "webcam" "Install webcam neede apps" \ + "microcode" "Update Intel/AMD CPU microcode" \ + "oibaf" "latest version of free graphic drivers, mesa, ..." \ + "nvidia370" "Install Nvidia 370 graphic drivers" \ + "nvidia375" "Install Nvidia 375 graphic drivers" \ + "nvidia378" "Install Nvidia 378 graphic drivers" \ + "nvidia381" "Install Nvidia 381 graphic drivers" \ + "nvidia384" "Install Nvidia 384 graphic drivers" \ + "nvidia387" "Install Nvidia 387 graphic drivers" \ + "nvidia390" "Install Nvidia 390 graphic drivers" \ + "nvidia396" "Install Nvidia 396 graphic drivers" \ + "tlp" "Install/Enable TLP for better power management " \ + "keyid" "Add udev rules for Key-ID FIDO U2F usb key" \ + "WI6320" "Fix Intel Wireless 6320 card config problem" \ + "Back" "Back" 3>&1 1>&2 2>&3) + + case $hardwareMenuOptions in + "cardreader") + installCardReaderMenu + ;; + "solaar") + installAppsFromListMenu + ;; + "webcam") + installWebcamMenu + ;; + "microcode") + updateMicrocode + ;; + "oibaf") + installOibafMenu + ;; + "nvidia370") + installNvidia370Menu + ;; + "nvidia375") + installNvidia375Menu + ;; + "nvidia378") + installNvidia378Menu + ;; + "nvidia381") + installNvidia381Menu + ;; + "nvidia384") + installNvidia384Menu + ;; + "nvidia387") + installNvidia387Menu + ;; + "nvidia390") + installNvidia390Menu + ;; + "nvidia396") + installNvidia396Menu + ;; + "tlp") + installTLPMenu + ;; + "keyid") + installKeyIDuDev + ;; + "WI6320") + fixWirelessIntel6320 + ;; + "Back") + break + ;; + esac + + done +} \ No newline at end of file diff --git a/repo_functions.sh b/repo_functions_ub1604.sh similarity index 100% rename from repo_functions.sh rename to repo_functions_ub1604.sh diff --git a/repo_functions_ub1804.sh b/repo_functions_ub1804.sh new file mode 100644 index 0000000..cfb15c8 --- /dev/null +++ b/repo_functions_ub1804.sh @@ -0,0 +1,1319 @@ +#------------------------------------------------------------------------------# +# Yggdrasil NG # +# compatibility : Mint 18, Ubuntu 16.04, Elementary and other derivatives # +# author : Francois B. (Makotosan/Shakasan) # +# licence : GPLv3 # +# website : https://makotonoblog.be/ # +#------------------------------------------------------------------------------# + +#-----------------------------------------------------------------------------# +# list of apps with required package manager and category # +#-----------------------------------------------------------------------------# + +# +# List of packages available +# fields : package name, package manager, category, unique ID for external functions +# +Apps="cifs-utils;apt;base;cifs-utils +xterm;apt;base;xterm +curl;apt;base;curl +mc;apt;base;mc +bmon;apt;base;bmon +htop;apt;base;htop +screen;apt;base;screen +dconf-cli;apt;base;dconf +dconf-editor;apt;base;dconf-editor +lnav;apt;base;lnav +exfat-fuse;apt;base;exfat-fuse +exfat-utils;apt;base;exfat-utils +iftop;apt;base;iftop +iptraf;apt;base;iptraf +mpg123;apt;base;mpg123 +debconf-utils;apt;base;debconf-utils +idle3-tools;apt;base;idle3-tools +snapd;apt;base;snapd +sysstat;apt;base;sysstat +spotify;snap;multimedia;spotify +slowmovideo;apt;multimedia;slowmovideo +sayonara;apt;multimedia;sayonara +qmmp;apt;multimedia;qmmp +qmmp-plugin-projectm;apt;multimedia;qmmp-plugin-projectm +shotcut;apt;multimedia;shotcut +audacious;apt;multimedia;audacious +dia;apt;multimedia;dia +mpv;apt;multimedia;mpv +picard;apt;multimedia;picard +inkscape;apt;multimedia;inkscape +aegisub;apt;multimedia;aegisub +aegisub-l10n;apt;multimedia;aegisub-l10n +mypaint;apt;multimedia;mypaint +mypaint-data-extras;apt;multimedia;mypaint-data-extras +audacity;apt;multimedia;audacity +blender;apt;multimedia;blender +kodi;apt;multimedia;kodi +digikam;apt;multimedia;digikam +synfigstudio;apt;multimedia;synfigstudio +mkvtoolnix-gui;apt;multimedia;mkvtoolnix-gui +rawtherapee;apt;multimedia;rawtherapee +hugin;apt;multimedia;hugin +xnview;apt;multimedia;xnview +asunder;apt;multimedia;asunder +milkytracker;apt;multimedia;milkytracker +pitivi;apt;multimedia;pitivi +openshot;apt;multimedia;openshot +smplayer;apt;multimedia;smplayer +smplayer-themes;apt;multimedia;smplayer-themes +smplayer-l10n;apt;multimedia;smplayer-l10n +selene;apt;multimedia;selene +gnome-mplayer;apt;multimedia;gnome-mplayer +handbrake;apt;multimedia;handbrake +avidemux2.6-qt;apt;multimedia;avidemux2.6-qt +avidemux2.6-plugins-qt;apt;multimedia;avidemux2.6-plugins-qt +mjpegtools;apt;multimedia;mjpegtools +twolame;apt;multimedia;twolame +lame;apt;multimedia;lame +banshee;apt;multimedia;banshee +banshee-extension-soundmenu;apt;multimedia;banshee-extension-soundmenu +gpicview;apt;multimedia;gpicview +vlc;apt;multimedia;vlc +shotwell;apt;multimedia;shotwell +darktable;apt;multimedia;darktable +ffmpeg;apt;multimedia;ffmpeg +flacon;apt;multimedia;flacon +scribus;apt;multimedia;scribus +gnome-font-viewer;apt;multimedia;gnome-font-viewer +moc;apt;multimedia;moc +webp;apt;multimedia;webp +simplescreenrecorder;apt;multimedia;simplescreenrecorder +simplescreenrecorder-lib;apt;multimedia;simplescreenrecorder-lib +simplescreenrecorder-lib:i386;apt;multimedia;simplescreenrecorder-lib:i386 +cuetools;apt;multimedia;cuetools +shntool;apt;multimedia;shntool +flac;apt;multimedia;flac +entangle;apt;multimedia;entangle +krita;apt;multimedia;krita +soundconverter;apt;multimedia;soundconverter +gimp;apt;multimedia;gimp +vidcutter;apt;multimedia;vidcutter +green-recorder;apt;multimedia;green-recorder +radiotray;apt;multimedia;radiotray +quodlibet;apt;multimedia;quodlibet +python-cddb;apt;multimedia;python-cddb +python-musicbrainz2;apt;multimedia;python-musicbrainz2 +gmusicbrowser;apt;multimedia;gmusicbrowser +peek;apt;multimedia;peek +bino;apt;multimedia;bino +owncloud-client;apt;internet;owncloud-client +syncthing-gtk;apt;internet;syncthing-gtk +syncthing;apt;internet;syncthing +insync;apt;internet;insync +discord;snap;internet;discord +quiterss;apt;internet;quiterss +opera-stable;apt;internet;opera-stable +google-chrome-stable;apt;internet;google-chrome-stable +xchat-gnome;apt;internet;xchat-gnome +xchat-gnome-indicator;apt;internet;xchat-gnome-indicator +chromium-browser;apt;internet;chromium-browser +chromium-browser-l10n;apt;internet;chromium-browser-l10n +nautilus-dropbox;apt;internet;nautilus-dropbox +filezilla;apt;internet;filezilla +hexchat;apt;internet;hexchat +mumble;apt;internet;mumble +imagedownloader;apt;internet;imagedownloader +california;apt;internet;california +midori;apt;internet;midori +geary;apt;internet;geary +corebird;apt;internet;corebird +telegram;apt;internet;telegram +skypeforlinux;apt;internet;skypeforlinux +nextcloud-client;apt;internet;nextcloud-client +nextcloud-client-caja;apt;internet;nextcloud-client-caja +deluge-gtk;apt;internet;deluge-gtk +deluge-torrent;apt;internet;deluge-torrent +vivaldi-stable;apt;internet;vivaldi-stable +transmission-gtk;apt;internet;transmission-gtk +qtqr;apt;utilities;qtqr +gqrcode;apt;utilities;gqrcode +cpu-g;apt;utilities;cpu-g +screenfetch;apt;utilities;screenfetch +xcalib;apt;utilities;xcalib +conky-manager;apt;utilities;conky-manager +conky-all;apt;utilities;conky-all +plank;apt;utilities;plank +indicator-sound-switcher;apt;utilities;indicator-sound-switcher +y-ppa-manager;apt;utilities;y-ppa-manager +synapse;apt;utilities;synapse +acetoneiso;apt;utilities;acetoneiso +guake;apt;utilities;guake +tilda;apt;utilities;tilda +psensor;apt;utilities;psensor +kazam;apt;utilities;kazam +bleachbit;apt;utilities;bleachbit +gparted;apt;utilities;gparted +gsmartcontrol;apt;utilities;gsmartcontrol +terminator;apt;utilities;terminator +aptik;apt;utilities;aptik +gufw;apt;utilities;gufw +numlockx;apt;utilities;numlockx +grub-customizer;apt;utilities;grub-customizer +unetbootin;apt;utilities;unebootin +zim;apt;utilities;zim +diodon;apt;utilities;diodon +pyrenamer;apt;utilities;pyrenamer +qt5ct;apt;utilities;qt5ct +qt4-qtconfig;apt;utilities;qt4-qtconfig +byobu;apt;utilities;byobu +mupdf;apt;utilities;mupdf +mupdf-tools;apt;utilities;mupdf-tools +ukuu;apt;utilities;ukuu +fcrackzip;apt;utilities;fcrackzip +rarcrack;apt;utilities;rarcrack +pdfcrack;apt;utilities;pdfcrack +figlet;apt;utilities;figlet +alltray;apt;utilities;alltray +cheat;pip;utilities;cheat +mate-sensors-applet-nvidia;apt;utilities;mate-sensors-applets-nvidia +woeusb;apt;utilities;woeusb +screenkey;apt;utilities;screenkey +tmsu;apt;utilities;tmsu +etcher-electron;apt;utilities;etcher-electron +pdfgrep;apt;utilities;pdfgrep +coinmon;npm;utilities;coinmon +tldr;pip;utilities;tldr +gyazo;apt;utilities;gyazo +fdupes;apt;utilities;fdupes +vulkan-utils;apt;utilities;vulkan-utils +python3-dev;apt;python;python3-dev +python3-pip;apt;python;python3-pip +python3-pyqt5;apt;python;python3-pyqt5 +pyqt5-dev-tools;apt;python;pyqt5-dev-tools +pip;pip;python;setuptools +setuptools;pip;python;setuptools +PyOpenGL;pip;python;PyOpenGL +tweepy;pip;python;tweepy +weppy;pip;python;weppy +py-term;pip;python;py-term +jstest-gtk;apt;games;jstest-gtk +dosbox;apt;games;dosbox +brasero;apt;burningtools;brasero +k3b;apt;burningtools;k3b +k3b-extrathemes;apt;burningtools;k3b-extrathemes +xfburn;apt;burningtools;xfburn +whois;apt;nettools;whois +iptraf;apt;nettools;iptraf +iperf;apt;nettools;iperf +wireshark;apt;nettools;wireshark +tshark;apt;nettools;tshark +zenmap;apt;nettools;zenmap +dsniff;apt;nettools;dsniff +aircrack-ng;apt;nettools;aricrack-ng +SpoofMAC;pip;nettools;SpoofMAC +speedtest-cli;pip;nettools;speedtest-cli +whatportis;pip;nettools;whatportis +nethogs;apt;nettools;nethogs +ssh_scan;gem;nettools;sshscan +caja-share;apt;cajaplugins;caja-share +caja-wallpaper;apt;cajaplugins;caja-wallpaper +caja-sendto;apt;cajaplugins;caka-sendto +caja-image-converter;apt;cajaplugins;caja-image-converter +insync-caja;apt;cajaplugins;insync-caja +nautilus;apt;nautilus;nautilus +file-roller;apt;nautilus;file-roller +nautilus-emblems;apt;nautilus;nautilus-emblems +nautilus-image-manipulator;apt;nautilus;nautilus-image-manipulator +nautilus-image-converter;apt;nautilus;nautilus-image-converter +nautilus-compare;apt;nautilus;nautilus-compare +nautilus-actions;apt;nautilus;nautilus-actions +nautilus-sendto;apt;nautilus;nautilus-sendto +nautilus-share;apt;nautilus;nautilus-share +nautilus-wipe;apt;nautilus;nautilus-wipe +nautilus-script-audio-convert;apt;nautilus;nautilus-script-audio-convert +nautilus-filename-repairer;apt;nautilus;filename-repairer +nautilus-gtkhash;apt;nautilus;nautilus-gtkhash +nautilus-ideviceinfo;apt;nautilus;nautilus-ideviceinfo +ooo-thumbnailer;apt;nautilus;ooo-thumbnailer +nautilus-dropbox;apt;nautilus;nautilus-dropbox +nautilus-script-manager;apt;nautilus;nautilus-script-manager +nautilus-columns;apt;nautilus;nautilus-columns +insync-nautilus;apt;nautilus;insync-nautilus +gtkam-gimp;apt;gimp;gtkam-gimp +gimp-gluas;apt;gimp;gimp-gluas +pandora;apt;gimp;pandora +gimp-data-extras;apt;gimp;gimp-data-extras +gimp-lensfun;apt;gimp;gimp-lensfun +gimp-gmic;apt;gimp;gimp-gmic +gimp-ufraw;apt;gimp;gimp-ufraw +gimp-texturize;apt;gimp;gimp-texturize +gimp-plugin-registry;apt;gimp;gimp-plugin-registry +rhythmbox-plugin-alternative-toolbar;apt;rhythmbox;rhythmbox-plugin-alternative-toolbar +rhythmbox-plugin-artdisplay;apt;rhythmbox;rhythmbox-plugin-artdisplay +rhythmbox-plugin-cdrecorder;apt;rhythmbox;rhythmbox-plugin-cdrecorder +rhythmbox-plugin-close-on-hide;apt;rhythmbox;rhythmbox-plugin-close-on-hide +rhythmbox-plugin-countdown-playlist;apt;rhythmbox;rhythmbox-plugin-countdown-playlist +rhythmbox-plugin-coverart-browser;apt;rhythmbox;rhythmbox-plugin-coverart-browser +rhythmbox-plugin-coverart-search;apt;rhythmbox;rhythmbox-pluginn-coverart-search +rhythmbox-plugin-desktopart;apt;rhythmbox;rhythmbox-plugin-desktopart +rhythmbox-plugin-equalizer;apt;rhythmbox;rhythmbox-plugin-equalizer +rhythmbox-plugin-fileorganizer;apt;rhythmbox;rhythmbox-plugin-fileorganizer +rhythmbox-plugin-fullscreen;apt;rhythmbox;rhythmbox-plugin-fullscreen +rhythmbox-plugin-hide;apt;rhythmbox;rhythmbox-plugin-hide +rhythmbox-plugin-jumptowindow;apt;rhythmbox;rhythmbox-plugin-jumptowindow +rhythmbox-plugin-llyrics;apt;rhythmbox;rhythmbox-plugin-llyrics +rhythmbox-plugin-looper;apt;rhythmbox;rhythmbox-plugin-looper +rhythmbox-plugin-opencontainingfolder;apt;rhythmbox;rhythmbox-plugin-opencontainingfolder +rhythmbox-plugin-parametriceq;apt;rhythmbox;rhythmbox-plugin-parametriceq +rhythmbox-plugin-playlist-import-export;apt;rhythmbox;rhythmbox-plugin-playlist +rhythmbox-plugin-podcast-pos;apt;rhythmbox;rhythmbox-plugin-podcast-pos +rhythmbox-plugin-randomalbumplayer;apt;rhythmbox;rhythmbox-plugin-randomalbumplayer +rhythmbox-plugin-rating-filters;apt;rhythmbox;rhythmbox-plugin-rating-filters +rhythmbox-plugin-remembertherhythm;apt;rhythmbox;rhythmbox-plugin-remembertherhythm +rhythmbox-plugin-repeat-one-song;apt;rhythmbox;rhythmbox-plugin-repeat-one-song +rhythmbox-plugin-rhythmweb;apt;rhythmbox;rhythmbox-plugin-rhythmweb +rhythmbox-plugin-screensaver;apt;rhythmbox;rhythmbox-plugin-screensaver +rhythmbox-plugin-smallwindow;apt;rhythmbox;rhythmbox-plugin-smallwindow +rhythmbox-plugin-spectrum;apt;rhythmbox;rhythmbox-plugin-spectrum +rhythmbox-plugin-suspend;apt;rhythmbox;rhythmbox-plugin-suspend +rhythmbox-plugin-tray-icon;apt;rhythmbox;rhythmbox-plugin-tray-icon +rhythmbox-plugin-visualizer;apt;rhythmbox;rhythmbox-plugin-visualizer +rhythmbox-plugin-wikipedia;apt;rhythmbox;rhythmbox-plugin-wikipedia +rhythmbox-plugins;apt;rhythmbox;rhythmbox-plugins +telegram-purple;apt;pidgin;telegram-purple +pidgin-skype;apt;pidgin;pidgin-skype +purple-facebook;apt;pidgin;purple-facebook +purple-hangouts;apt;pidgin;purple-hangouts +pidgin-hangouts;apt;pidgin;pidgin-hangouts +pidgin-skypeweb;apt;pidgin;pidgin-skypeweb +purple-skypeweb;apt;pidgin;purple-skypeweb +unbound;apt;unbound;unbound +ambiance-crunchy;apt;gtkthemes;ambiance-crunchy +arc-theme;apt;gtkthemes;arc-theme +ambiance-colors;apt;gtkthemes;ambiance-colors +radiance-colors;apt;gtkthemes;radiance-colors +ambiance-flat-colors;apt;gtkthemes;ambiance-flat-colors +vivacious-colors-gtk-dark;apt;gtkthemes;vivacious-colors-gtk-dark +vivacious-colors-gtk-light;apt;gtkthemes;vivacious-colors-gtk-light +yosembiance-gtk-theme;apt;gtkthemes;yosembiance-gtk-theme +ambiance-blackout-colors;apt;gtkthemes;ambiance-blackout-colors +ambiance-blackout-flat-colors;apt;gtkthemes;ambiance-blackout-flat-colors +radiance-flat-colors;apt;gtkthemes;radiance-flat-colors +vibrancy-colors;apt;gtkthemes;vibrancy-colors +vivacious-colors;apt;gtkthemes;vivacious-colors +numix-gtk-theme;apt;gtkthemes;numix-gtk-theme +arc-icons;apt;icons;arc-icons +ultra-flat-icons;apt;icons;ultra-flat-icons +myelementary;apt;icons;myelementary +ghost-flat-icons;apt;icons;ghost-flat-icons +faenza-icon-theme;apt;icons;faenza-icon-theme +faience-icon-theme;apt;icons;faience-icon-theme +vibrantly-simple-icon-theme;apt;icons;vibrantly-simple-icon-theme +rave-x-colors-icons;apt;icons;rave-x-colors-icons +ravefinity-x-icons;apt;icons;ravefinity-x-icons +numix-icon-theme;apt;icons;numix-icon-theme +numix-icon-theme-circle;apt;icons;numix-icon-theme-circle +solaar;apt;solaar;solaar +pcscd;apt;cardreader;pcscd +pcsc-tools;apt;cardreader;pcsc-tools +libacr38u;apt;cardreader;libacr38u +guvcview;apt;webcam;guvcview +cheese;apt;webcam;cheese +nvidia-370;apt;nvidia-370;nvidia-370 +nvidia-settings;apt;nvidia-370;nvidia-settings +nvidia-opencl-icd-370;apt;nvidia-370;nvidia-opencl-icd-370 +nvidia-375;apt;nvidia-375;nvidia-375 +nvidia-settings;apt;nvidia-375;nvidia-settings +nvidia-opencl-icd-375;apt;nvidia-375;nvidia-opencl-icd-375 +nvidia-378;apt;nvidia-378;nvidia-378 +nvidia-settings;apt;nvidia-378;nvidia-settings +nvidia-opencl-icd-378;apt;nvidia-378;nvidia-opencl-icd-378 +libcuda1-378;apt;nvidia-378;libcuda1-378 +nvidia-381;apt;nvidia-381;nvidia-381 +nvidia-settings;apt;nvidia-381;nvidia-settings +nvidia-opencl-icd-381;apt;nvidia-381;nvidia-opencl-icd-381 +libcuda1-381;apt;nvidia-381;libcuda1-381 +nvidia-384;apt;nvidia-384;nvidia-384 +nvidia-settings;apt;nvidia-384;nvidia-settings +nvidia-opencl-icd-384;apt;nvidia-384;nvidia-opencl-icd-384 +libcuda1-384;apt;nvidia-384;libcuda1-384 +nvidia-387;apt;nvidia-387;nvidia-387 +nvidia-settings;apt;nvidia-387;nvidia-settings +nvidia-opencl-icd-387;apt;nvidia-387;nvidia-opencl-icd-387 +libcuda1-387;apt;nvidia-387;libcuda1-387 +nvidia-390;apt;nvidia-390;nvidia-390 +nvidia-settings;apt;nvidia-390;nvidia-settings +nvidia-opencl-icd-390;apt;nvidia-390;nvidia-opencl-icd-390 +libcuda1-390;apt;nvidia-390;libcuda1-390 +nvidia-396;apt;nvidia-396;nvidia-396 +nvidia-settings;apt;nvidia-396;nvidia-settings +nvidia-opencl-icd-396;apt;nvidia-396;nvidia-opencl-icd-396 +libcuda1-396;apt;nvidia-396;libcuda1-396 +tlp;apt;tlp;tlp +notepadqq;apt;dev;notepadqq +agave;apt;dev;agave +utext;apt;dev;utext +gpick;apt;dev;gpick +virtualbox-5.2;apt;dev;virtualbox-5.2 +build-essential;apt;dev;build-essential +ubuntu-make;apt;dev;ubuntu-make +ghex;apt;dev;ghex +glade;apt;dev;glade +eric;apt;dev;eric +bluefish;apt;dev;bluefish +meld;apt;dev;meld +zeal;apt;dev;zeal +shellcheck;apt;dev;shellcheck +umbrello;apt;dev;umbrello +ack-grep;apt;dev;ack-grep +ansible;apt;dev;ansible +docker-ce;apt;dev;docker-ce +remark-lint;npm;dev;remark-lint +beautysh;pip;dev;beautysh +mycli;pip;dev;mycli +sqlitebrowser;apt;dev;sqlitebrowser +nodejs;apt;javascript;nodejs8lts +javascript-common;apt;javascript;javascript-common +yarn;npm;javascript;yarn +emma-cli;npm;javascript;emma-cli +jshint;npm;javascript;jshint +oracle-java10-installer;apt;java10;oracle-java10-installer +oracle-java10-set-default;apt;java10;oracle-java10-set-default +php7.0-cli;apt;php;php7.0-cli +php-pear;apt;php;php-pear +composer;apt;php;composer +luajit;apt;lua;luajit +ruby-dev;apt;ruby;ruby-dev +anjuta;apt;anjuta;anjuta +anjuta-extras;apt;anjuta;anjuta-extras +brackets;apt;brackets;brackets +codeblocks;apt;codeblocks;codeblocks +codeblocks-contrib;apt;codeblocks;codeblocks-contrib +geany;apt;geany;geany +geany-plugins;apt;geany;geany-plugins +geany-plugin-markdown;apt;geany;geany-plugin-markdown +pycharm-community;snap;pycharm;pycharm +sublime-text;apt;sublime-text;sublime-text +kicad;apt;cad;kicad +kicad-locale-fr;apt;cad;kicad-locale-fr +librecad;apt;cad;librecad +freecad;apt;cad;freecad +code;apt;code;code +atom;apt;atom;atom +sync-settings;apm;atom;sync-settings +sqlparse;pip;atom;sqlparse +flake8;pip;atom;flake8 +autopep8;pip;atom;autopep8 +htmlbeautifier;gem;atom;htmlbeautifier +kodi;apt;beta;kodi-beta +kodi;apt;nightly;kodi-nightly +nitrogen;apt;nitrogen;nitrogen +firefox-trunk;apt;nightly;firefox-trunk +firefox-trunk-locale-fr;apt;nightly;firefox-trunk-locale-fr +libreoffice;apt;office;libreoffice6 +winehq-devel;apt;wine;winehq-devel +winetricks;apt;wine;winetricks +playonlinux;apt;wine;playonlinux +mongodb-org;apt;mongodb;mongodb +qt4-dev-tools;apt;qt;qt4-dev-tools +qt4-linguist-tools;apt;qt;qt4-linguist-tools +qt5-doc;apt;qt;qt5-doc +qttools5-doc;apt;qt;qttools5-doc +qttools5-dev-tools;apt;qt;qttools5-dev-tools +qttools5-examples;apt;qt;qttools5-examples +qttools5-doc-html;apt;qt;qttools5-doc-html +fbreader;apt;ebook;fbreader +calibre;apt;ebook;calibre +android-studio;apt;androidstudio;androidstudio +intellij-idea-community;snap;idea;idea" + +#-----------------------------------------------------------------------------# +# Specific Repo list and functions # +#-----------------------------------------------------------------------------# + +# +# list of specific repositories +# fields : unique ID, function to add repo +# +AppsRepo="kodi-beta;addRepo_KodiBeta +kodi-nightly;addRepo_KodiNightly +libreoffice6;addRepo_Libreoffice6 +winehq-devel;addRepo_Wine +mongodb;addRepo_MongoDB3CE +gyazo;addRepo_Gyazo +code;addRepo_VSCode +androidstudio;addRepo_AndroidStudio +docker-ce;addRepo_DockerCE +ansible;addRepo_Ansible +etcher-electron;addRepo_Etcher +sublime-text;addRepo_SublimeText +vivaldi-stable;addRepo_Vivaldi +virtualbox-5.2;addRepo_VirtualBox +owncloud-client;addRepo_OwnCloud +syncthing-gtk;addRepo_Syncthing +opera-stable;addRepo_Opera +insync;addRepo_Insync +google-chrome-stable;addRepo_ChromeStable +atom;addRepo_Atom +nextcloud-client;addRepo_NextCloud +wireshark;addRepo_WireShark +darktable;addRepo_DarkTable +brackets;addRepo_Brackets +kicad;addRepo_Kicad +nodejs8lts;addRepo_NodeLts8 +telegram;addRepo_Telegram +skypeforlinux;addRepo_SkypeForLinux +shotwell;addRepo_Shotwell +peek;addRepo_Peek +sqlitebrowser;addRepo_SQLiteBrowser +ukuu;addRepo_Teejee2008 +aptik;addRepo_Teejee2008 +conky-manager;addRepo_Teejee2008 +avidemux2.6-plugins-qt;addRepo_Avidemux2.6 +avidemux2.6-qt;addRepo_Avidemux2.6 +tmsu;addRepo_Tmsu +quiterss;addRepo_Quiterss +transmission-gtk;addRepo_Transmissionbt +handbrake;addRepo_Handbrake +notepadqq;addRepo_Notepadqq +mumble;addRepo_Mumble +utext;addRepo_Utext +flacon;addRepo_Flacon +y-ppa-manager;addRepo_YPPAManager +shotcut;addRepo_Shotcut +diodon;addRepo_Diodon +sayonara;addRepo_Sayonara +zeal;addRepo_Zeal +corebird;addRepo_Corebird +deluge-torrent;addRepo_Deluge +deluge-gtk;addRepo_Deluge +kodi;addRepo_Kodi +indicator-sound-switcher;addRepo_IndicatorSoundSwitcher +krita;addRepo_Krita +gimp-gmic;addRepo_Gimp +gimp;addRepo_Gimp +geary;addRepo_Geary +vidcutter;addRepo_Vidcutter +ambiance-crunchy;addRepo_NoobslabThemes +arc-theme;addRepo_NoobslabThemes +ambiance-colors;addRepo_Ravefinity +radiance-colors;addRepo_Ravefinity +ambiance-flat-colors;addRepo_Ravefinity +vivacious-colors-gtk-dark;addRepo_Ravefinity +vivacious-colors-gtk-light;addRepo_Ravefinity +yosembiance-gtk-theme;addRepo_NoobslabThemes +ambiance-blackout-colors;addRepo_Ravefinity +ambiance-blackout-flat-colors;addRepo_Ravefinity +radiance-flat-colors;addRepo_Ravefinity +vibrancy-colors;addRepo_Ravefinity +vivacious-colors;addRepo_NoobslabThemes +arc-icons;addRepo_NoobslabIcons +ultra-flat-icons;addRepo_NoobslabIcons +myelementary;addRepo_NoobslabIcons +ghost-flat-icons;addRepo_NoobslabIcons +faenza-icon-theme;addRepo_NoobslabIcons +vibrantly-simple-icon-theme;addRepo_Ravefinity +rave-x-colors-icons;addRepo_Ravefinity +ravefinity-x-icons;addRepo_Ravefinity +oracle-java10-installer;addRepo_Java10 +oracle-java10-set-default;addRepo_Java10 +green-recorder;addRepo_GreenRecorder +hugin;addRepo_Hugin +simplescreenrecorder;addRepo_SimpleScreenRecorder +simplescreenrecorder-lib;addRepo_SimpleScreenRecorder +simplescreenrecorder-lib:i386;addRepo_SimpleScreenRecorder +slowmovideo;addRepo_Slowmovideo +zim;addRepo_Zim +grub-customizer;addRepo_GrubCustomizer +vlc;addRepo_VLC +numix-gtk-theme;addRepo_Numix +numix-icon-theme;addRepo_Numix +numix-icon-theme-circle;addRepo_Numix +rhythmbox-plugin-alternative-toolbar;addRepo_Rhythmbox +rhythmbox-plugin-artdisplay;addRepo_Rhythmbox +rhythmbox-plugin-cdrecorder;addRepo_Rhythmbox +rhythmbox-plugin-close-on-hide;addRepo_Rhythmbox +rhythmbox-plugin-countdown-playlist;addRepo_Rhythmbox +rhythmbox-plugin-coverart-browser;addRepo_Rhythmbox +rhythmbox-plugin-coverart-search;addRepo_Rhythmbox +rhythmbox-plugin-desktopart;addRepo_Rhythmbox +rhythmbox-plugin-equalizer;addRepo_Rhythmbox +rhythmbox-plugin-fileorganizer;addRepo_Rhythmbox +rhythmbox-plugin-fullscreen;addRepo_Rhythmbox +rhythmbox-plugin-hide;addRepo_Rhythmbox +rhythmbox-plugin-jumptowindow;addRepo_Rhythmbox +rhythmbox-plugin-llyrics;addRepo_Rhythmbox +rhythmbox-plugin-looper;addRepo_Rhythmbox +rhythmbox-plugin-opencontainingfolder;addRepo_Rhythmbox +rhythmbox-plugin-parametriceq;addRepo_Rhythmbox +rhythmbox-plugin-playlist-import-export;addRepo_Rhythmbox +rhythmbox-plugin-podcast-pos;addRepo_Rhythmbox +rhythmbox-plugin-randomalbumplayer;addRepo_Rhythmbox +rhythmbox-plugin-rating-filters;addRepo_Rhythmbox +rhythmbox-plugin-remembertherhythm;addRepo_Rhythmbox +rhythmbox-plugin-repeat-one-song;addRepo_Rhythmbox +rhythmbox-plugin-rhythmweb;addRepo_Rhythmbox +rhythmbox-plugin-screensaver;addRepo_Rhythmbox +rhythmbox-plugin-smallwindow;addRepo_Rhythmbox +rhythmbox-plugin-spectrum;addRepo_Rhythmbox +rhythmbox-plugin-suspend;addRepo_Rhythmbox +rhythmbox-plugin-tray-icon;addRepo_Rhythmbox +rhythmbox-plugin-visualizer;addRepo_Rhythmbox +rhythmbox-plugin-wikipedia;addRepo_Rhythmbox +rhythmbox-plugins;addRepo_Rhythmbox +vulkan-utils;addRepo_NvidiaDrivers +nvidia-settings;addRepo_NvidiaDrivers +nvidia-370;addRepo_NvidiaDrivers +nvidia-opencl-icd-370;addRepo_NvidiaDrivers +nvidia-375;addRepo_NvidiaDrivers +nvidia-opencl-icd-375;addRepo_NvidiaDrivers +nvidia-378;addRepo_NvidiaDrivers +nvidia-opencl-icd-378;addRepo_NvidiaDrivers +libcuda1-378;addRepo_NvidiaDrivers +nvidia-381;addRepo_NvidiaDrivers +nvidia-opencl-icd-381;addRepo_NvidiaDrivers +libcuda1-381;addRepo_NvidiaDrivers +nvidia-384;addRepo_NvidiaDrivers +nvidia-opencl-icd-384;addRepo_NvidiaDrivers +libcuda1-384;addRepo_NvidiaDrivers +nvidia-387;addRepo_NvidiaDrivers +nvidia-opencl-icd-387;addRepo_NvidiaDrivers +libcuda1-387;addRepo_NvidiaDrivers +nvidia-390;addRepo_NvidiaDrivers +nvidia-opencl-icd-390;addRepo_NvidiaDrivers +libcuda1-390;addRepo_NvidiaDrivers +nvidia-396;addRepo_NvidiaDrivers +nvidia-opencl-icd-396;addRepo_NvidiaDrivers +libcuda1-396;addRepo_NvidiaDrivers +rawtherapee;addRepo_DhorMyWay +entangle;addRepo_DhorMyWay +mkvtoolnix-gui;addRepo_MKVToolnix +purple-facebook;addRepo_Jgeboski +cpu-g;addRepo_Atareao +gqrcode;addRepo_Atareao +imagedownloader;addRepo_Atareao +audacious;addRepo_Webupd8 +nautilus-columns;addRepo_Webupd8 +nautilus-terminal;addRepo_Webupd8 +purple-hangouts;addRepo_Webupd8 +purple-skypeweb;addRepo_Webupd8 +qt5ct;addRepo_Webupd8 +syncthing-gtk;addRepo_Webupd8 +telegram-purple;addRepo_Webupd8 +screenkey;addRepo_Webupd8 +yad;addRepo_Webupd8 +woeusb;addRepo_Webupd8" + +# +# Audacious, Guake +# +function addRepo_Webupd8 () { + addPPA ppa:nilarimogard/webupd8 +} + +# +# cpu-g, gqrcode, imagedownloader +# +function addRepo_Atareao () { + addPPA ppa:atareao/atareao +} + +# +# purple facebook +# +function addRepo_Jgeboski () { + addKey "https://jgeboski.github.io/obs.key" + addRepo jgeboski.list \ + "deb http://download.opensuse.org/repositories/home:/jgeboski/xUbuntu_16.04/ ./" +} + +# +# MKVToolnix +# +function addRepo_MKVToolnix () { + addKey "https://mkvtoolnix.download/gpg-pub-moritzbunkus.txt" + addRepo mkv.list \ + "deb https://mkvtoolnix.download/ubuntu/ xenial main" \ + "deb-src https://mkvtoolnix.download/ubuntu/ xenial main" +} + +# +# Entangle, Rawtherapee +# +function addRepo_DhorMyWay () { + addPPA ppa:dhor/myway +} + +# +# Oibaf +# - newest versions of free/open GPU drivers +# - newest versions of Mesa, .... +# +function addRepo_Oibaf () { + addPPA ppa:oibaf/graphics-drivers +} + +# +# Nvidia drivers +# +function addRepo_NvidiaDrivers () { + addPPA ppa:graphics-drivers/ppa +} + +# +# Rhythmbox +# +function addRepo_Rhythmbox () { + addPPA ppa:fossfreedom/rhythmbox + addPPA ppa:fossfreedom/rhythmbox-plugins +} + +# +# Numix themes/icons +# +function addRepo_Numix () { + addPPA ppa:numix/ppa +} + +# +# ravefinity themes +# +function addRepo_Ravefinity () { + addPPA ppa:ravefinity-project/ppa +} + +# +# VLC +# +function addRepo_VLC () { + addPPA ppa:videolan/stable-daily +} + +# +# Grub-Customizer +# +function addRepo_GrubCustomizer () { + addPPA ppa:danielrichter2007/grub-customizer +} + +# +# Zim +# +function addRepo_Zim () { + addPPA ppa:jaap.karssenberg/zim +} + +# +# Slowmovideo +# +function addRepo_Slowmovideo () { + addPPA ppa:ubuntuhandbook1/slowmovideo +} + +# +# Simple-Screen-Recorder +# +function addRepo_SimpleScreenRecorder () { + addPPA ppa:maarten-baert/simplescreenrecorder +} + +# +# Hugin +# +function addRepo_Hugin () { + addPPA ppa:hugin/hugin-builds +} + +# +# Green-Recorder +# +function addRepo_GreenRecorder () { + addPPA ppa:fossproject/ppa +} + +# +# Oracle JAVA 10 +# +function addRepo_Java10 () { + addPPA ppa:linuxuprising/java +} + +# +# Noobslab icons +# +function addRepo_NoobslabIcons () { + addPPA ppa:noobslab/icons +} + +# +# Noobslab themes +# +function addRepo_NoobslabThemes () { + addPPA ppa:noobslab/themes +} + +# +# Vidcutter +# +function addRepo_Vidcutter () { + addPPA ppa:ozmartian/apps +} + + +# +# Geary +# +function addRepo_Geary () { + addPPA ppa:geary-team/releases +} + +# +# Gimp / Gmic +# +function addRepo_Gimp () { +addPPA ppa:otto-kesselgulasch/gimp +} + +# +# Krita +# +function addRepo_Krita () { + addPPA ppa:kritalime/ppa +} + +# +# indicator-sound-switcher +# +function addRepo_IndicatorSoundSwitcher () { + addPPA ppa:yktooo/ppa +} + +# +# Kodi / XBMC +# +function addRepo_Kodi () { +addPPA ppa:team-xbmc/ppa +} + +# +# Deluge +# +function addRepo_Deluge () { +addPPA ppa:deluge-team/ppa +} + +# +# Corebird +# +function addRepo_Corebird () { +addPPA ppa:ubuntuhandbook1/corebird +} + +# +# Zeal +# +function addRepo_Zeal () { + addPPA ppa:zeal-developers/ppa +} + +# +# Sayonara +# +function addRepo_Sayonara () { +addPPA ppa:lucioc/sayonara +} + +# +# Diodon +# +function addRepo_Diodon () { + addPPA ppa:diodon-team/stable +} + +# +# Shotcut +# +function addRepo_Shotcut () { + addPPA ppa:haraldhv/shotcut +} + +# +# Y-PPA-Manager +# +function addRepo_YPPAManager () { +addPPA ppa:webupd8team/y-ppa-manager +} + +# +# flacon +# +function addRepo_Flacon () { + addPPA ppa:flacon/ppa +} + +# +# Utext +# +function addRepo_Utext () { + addPPA ppa:atareao/utext +} + +# +# Mumble +# +function addRepo_Mumble () { + addPPA ppa:mumble/release +} + +# +# Notepadqq +# +function addRepo_Notepadqq () { + addPPA ppa:notepadqq-team/notepadqq +} + +# +# Handbrake +# +function addRepo_Handbrake () { + addPPA ppa:stebbins/handbrake-releases +} + +# +# Transmission-BT +# +function addRepo_Transmissionbt () { + addPPA ppa:transmissionbt/ppa +} + +# +# QuiteRSS +# +function addRepo_Quiterss () { + addPPA ppa:quiterss/quiterss +} + +# +# TMSU +# +function addRepo_Tmsu () { + addPPA ppa:tmsu/ppa +} + +# +# Avidemux +# +function addRepo_Avidemux2.6 () { + addPPA ppa:ubuntuhandbook1/avidemux +} + +# +# aptik, conky-manager, selene, timeshift, ukuu +# +function addRepo_Teejee2008 () { + addPPA ppa:teejee2008/ppa +} + +# +# SQLiteBrowser +# +function addRepo_SQLiteBrowser () { + addPPA ppa:linuxgndu/sqlitebrowser +} + +# +# Peek +# +function addRepo_Peek () { + addPPA ppa:peek-developers/stable +} + +# +# Shotwell +# +function addRepo_Shotwell () { + addPPA ppa:yg-jensge/shotwell +} + +# +# Telegram +# +function addRepo_Telegram () { + addPPA ppa:atareao/telegram +} + +# +# Skype for Linux +# +function addRepo_SkypeForLinux () { + addKey "https://repo.skype.com/data/SKYPE-GPG-KEY" + addRepo "skypeforlinux.list" \ + "deb [arch=amd64] https://repo.skype.com/deb stable main" +} + +# +# Node 8 LTS +# +function addRepo_NodeLts8 () { + addKey "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" + addRepo "nodesource.list" \ + "deb https://deb.nodesource.com/node_8.x xenial main" \ + "deb-src https://deb.nodesource.com/node_8.x xenial main" +} + +# +# Kicad 4 +# +function addRepo_Kicad () { + addPPA ppa:js-reynaud/kicad-4 +} + +# +# Brackets IDE +# +function addRepo_Brackets () { + addPPA ppa:webupd8team/brackets +} + +# +# Darktable RAW Editor +# +function addRepo_DarkTable () { + addPPA ppa:pmjdebruijn/darktable-release +} + +# +# WireShark +# +function addRepo_WireShark () { +addPPA ppa:wireshark-dev/stable +} + +# +# NextCloud +# +function addRepo_NextCloud () { + addPPA ppa:nextcloud-devs/client +} + +# +# Atom IDE +# +function addRepo_Atom () { + addKey "https://packagecloud.io/AtomEditor/atom/gpgkey" + addRepo atom.list \ + "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" +} + +# +# Google Chrome (stable) +# +function addRepo_ChromeStable () { + addKey "https://dl.google.com/linux/linux_signing_key.pub" + addRepo google-chrome.list \ + "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" +} + +# +# Insync +# +function addRepo_Insync () { + addKey "https://d2t3ff60b2tol4.cloudfront.net/services@insynchq.com.gpg.key" + addRepo insync.list \ + "deb http://apt.insynchq.com/ubuntu xenial non-free contrib" +} + +# +# Opera (stable) +# +function addRepo_Opera () { + addKey "http://deb.opera.com/archive.key" + addRepo opera.list \ + "deb http://deb.opera.com/opera-stable/ stable non-free" +} + +# +# Syncthing +# +function addRepo_Syncthing () { + addKey "https://syncthing.net/release-key.txt" + addRepo syncthing.list \ + "deb http://apt.syncthing.net/ syncthing release" +} + +# +# OwnCloud +# +function addRepo_OwnCloud () { + addKey "http://download.opensuse.org/repositories/isv:ownCloud:desktop/Ubuntu_16.04/Release.key" + addRepo owncloud-client.list \ + "deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_16.04/ /" +} + +# +# VirtualBox +# +function addRepo_VirtualBox () { + addKey "http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc" + addKey "http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc" + addRepo virtualbox.list \ + "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" +} + +# +# Vivaldi +# +function addRepo_Vivaldi () { + addKey "http://repo.vivaldi.com/stable/linux_signing_key.pub" + addRepo vivaldi.list \ + "deb http://repo.vivaldi.com/stable/deb/ stable main " +} + +# +# SublimeText +# +function addRepo_SublimeText () { + addKey "https://download.sublimetext.com/sublimehq-pub.gpg" + addRepo sublime-text.list \ + "deb https://download.sublimetext.com/ apt/dev/" +} + +# +# Etcher +# +function addRepo_Etcher () { + addKey "hkp://pgp.mit.edu:80" \ + "379CE192D401AB61" + addRepo "etcher.list" \ + "deb https://dl.bintray.com/resin-io/debian stable etcher" +} + +# +# Ansible +# +function addRepo_Ansible () { + addPPA ppa:ansible/ansible +} + +# +# Docker CE +# +function addRepo_DockerCE () { + addKey "https://download.docker.com/linux/ubuntu/gpg" + addRepo "docker.list" \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" +} + +# +# Gyazo +# +function addRepo_Gyazo () { + addKey "https://packagecloud.io/gyazo/gyazo-for-linux/gpgkey" + addRepo "gyazo_gyazo-for-linux.list" \ + "deb https://packagecloud.io/gyazo/gyazo-for-linux/ubuntu/ xenial main" \ + "deb-src https://packagecloud.io/gyazo/gyazo-for-linux/ubuntu/ xenial main" +} + +# +# MongoDB 3 CE +# +function addRepo_MongoDB3CE () { + addKey "https://www.mongodb.org/static/pgp/server-3.6.asc" + addRepo "mongodb-org-3.6.list" \ + "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" +} + +# +# Wine Build +# +function addRepo_Wine () { + addKey "https://dl.winehq.org/wine-builds/Release.key" + addRepo "winehq.list" \ + "deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main" +} + +# +# LibreOffice 6 +# +function addRepo_Libreoffice6 () { + addPPA ppa:libreoffice/ppa +} + +# +# Kodi (Beta) +# +function addRepo_KodiBeta () { + addPPA ppa:team-xbmc/unstable +} + +# +# Kodi (Nightly) +# +function addRepo_KodiNightly () { + addPPA ppa:team-xbmc/xbmc-nightly +} + +# +# Visual Studio Code +# +function addRepo_VSCode () { + addKey "https://packages.microsoft.com/keys/microsoft.asc" + addRepo "vscode.list" \ + "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" +} + +# +# Android-Studio +# +function addRepo_AndroidStudio () { + addPPA ppa:maarten-fonville/android-studio +} + +#-----------------------------------------------------------------------------# +# Package post install functions list # +#-----------------------------------------------------------------------------# + +# +# list of post install functions +# fields : unique ID, function to process after install +# +AppsTrtFct="nitrogen;nitrogen_TrtFct +mongodb;mongodb_TrtFct +qttools5-dev-tools;qt_TrtFct +plank;plank_TrtFct +androidstudio;android_TrtFct +nodejs8lts;nodejs8lts_TrtFct" + +# +# +# +function nodejs8lts_TrtFct () { + msg "Sanitizing NodeJS install" + if which /usr/local/bin/node >/dev/null; then + runCmd "sudo rm /usr/local/bin/node" \ + "cleaning/removing legacy node files" + else + print "[INFO] nothing to clean, good :-)" + fi +} + +# +# Android Env for adb, fastboot, .... +# +function android_TrtFct () { + msg "Adding Android devices UDEV rules" + + sudo sh -c "echo 'SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0502\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Acer\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0b05\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Asus\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"413c\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Dell\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0489\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Foxconn\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"04c5\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Fujitsu\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"04c5\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Fujitsu-Toshiba\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"091e\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Garmin-Asus\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"18d1\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Google-Nexus\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"201E\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Haier\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"109b\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Hisense\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0bb4\", MODE=\"0666\", OWNER=\""$myHomedir"\" # HTC\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"12d1\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Huawei\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"8087\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Intel\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"24e3\", MODE=\"0666\", OWNER=\""$myHomedir"\" # K-Touch\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"2116\", MODE=\"0666\", OWNER=\""$myHomedir"\" # KT Tech\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0482\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Kyocera\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"17ef\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Lenovo\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1004\", MODE=\"0666\", OWNER=\""$myHomedir"\" # LG\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"22b8\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Motorola\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0e8d\", MODE=\"0666\", OWNER=\""$myHomedir"\" # MTK\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0409\", MODE=\"0666\", OWNER=\""$myHomedir"\" # NEC\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"2080\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Nook\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0955\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Nvidia\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"2257\", MODE=\"0666\", OWNER=\""$myHomedir"\" # OTGV\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"10a9\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Pantech\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1d4d\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Pegatron\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0471\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Philips\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"04da\", MODE=\"0666\", OWNER=\""$myHomedir"\" # PMC-Sierra\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"05c6\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Qualcomm\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1f53\", MODE=\"0666\", OWNER=\""$myHomedir"\" # SK Telesys\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"04e8\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Samsung\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"04dd\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Sharp\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"054c\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Sony\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0fce\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Sony Ericsson\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0fce\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Sony Mobile Communications\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"2340\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Teleepoch\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0930\", MODE=\"0666\", OWNER=\""$myHomedir"\" # Toshiba\n\ +SUBSYSTEM==\"usb\", ATTR{idVendor}==\"19d2\", MODE=\"0666\", OWNER=\""$myHomedir"\" # ZTE' > /etc/udev/rules.d/99-android.rules" + + runCmd "sudo service udev restart" \ + "restarting UDEV service" +} + +# +# Plank themes +#TODO: test it +function plank_TrtFct () { + typeset ret_code + + if ! (( $(ps -ef | grep -v grep | grep plank | wc -l) > 0 )); then + plank 2&>1 >/dev/null & + sleep 10 + fi + + yes | sh -c "cd ~ \ + && mkdir -p ~/.temp-plank-themer \ + && cd ~/.temp-plank-themer \ + && wget https://github.com/rhoconlinux/plank-themer/archive/master.zip \ + && unzip master.zip \ + && cd plank-themer-master/ \ + && rm -fR ~/.config/plank/dock1/theme_index; \ + rm -fR ~/.config/plank/dock1/themes-repo; \ + cp -a theme_index/ ~/.config/plank/dock1 \ + && cp -a themes-repo/ ~/.config/plank/dock1 \ + && cd ~ \ + && rm -R ~/.temp-plank-themer \ + && sh ~/.config/plank/dock1/theme_index/plank-on-dock-themer.sh" &>> $logFile + ret_code=$? + retCode $ret_code +} + +# +# QT5 Dev Tools +# +function qt_TrtFct () { + runCmd "sudo ln -s /usr/share/qtchooser/qt5-x86_64-linux-gnu.conf /usr/lib/x86_64-linux-gnu/qtchooser/default.conf" \ + "set QT5 as default" + + createAppShortcut "/usr/bin/designer" \ + "" \ + "GNOME;GTK;Development;IDE" \ + "QT Designer 5" \ + "local" \ + update-menus +} + +# +# MongoDB 3 CE +# +function mongodb_TrtFct () { + runCmd "sudo systemctl enable mongod.service" \ + "enabling mongod service at boot" + runCmd "sudo systemctl start mongod.service" \ + "starting mongod service" +} + +# +# nitrogen post install function +# +function nitrogen_TrtFct () { + if isMate; then + runCmd "gsettings set org.mate.background draw-background false" \ + "disabling Caja background management" + runCmd "gsettings set org.mate.background show-desktop-icons false" \ + "disabling Caja desktop icons management" + + createAppShortcut "bash -c \"sleep 10; nitrogen --restore\"" \ + "/usr/share/icons/hicolor/48x48/apps/nitrogen.png" \ + "Utility;GTK" \ + "Nitrogen" \ + "local" \ + "start" + update-menus + else + printf "[ERR] only Mate Desktop is currently supported\n" + fi +} diff --git a/tools_functions.sh b/tools_functions_ub1604.sh similarity index 100% rename from tools_functions.sh rename to tools_functions_ub1604.sh diff --git a/tools_functions_ub1804.sh b/tools_functions_ub1804.sh new file mode 100644 index 0000000..adfce03 --- /dev/null +++ b/tools_functions_ub1804.sh @@ -0,0 +1,145 @@ +#------------------------------------------------------------------------------# +# Yggdrasil NG # +# compatibility : Mint 18, Ubuntu 16.04, Elementary and other derivatives # +# author : Francois B. (Makotosan/Shakasan) # +# licence : GPLv3 # +# website : https://makotonoblog.be/ # +#------------------------------------------------------------------------------# + +#-----------------------------------------------------------------------------# +# tools and config functions # +#-----------------------------------------------------------------------------# + +# +# enable ufw at boot time and add rules for installed apps +# +function enableUFW () { + runCmd "sudo ufw enable"\ + "enabling UFW at boot" + + if which syncthing >/dev/null; then + runCmd "sudo ufw allow syncthing" \ + "adding UFW rules for Syncthing" + fi +} + +# +# enable numlock by default on LightDM +# +function enableNumLockX () { + checkAndInstallDep apt numlockx numlockx + if which lightdm >/dev/null; then + runCmd "sudo cp /etc/lightdm/lightdm.conf.d/70-linuxmint.conf /etc/lightdm/lightdm.conf.d/70-linuxmint.conf.yggbak" \ + "backing up lightdm original config file" + runCmd "echo -e '\ngreeter-setup-script=/usr/bin/numlockx on' | sudo tee -a /etc/lightdm/lightdm.conf.d/70-linuxmint.conf" \ + "enabling numlockx on in lightdm at boot" + fi +} + +# +# /tmp in RAM by modifying /etc/fstab +#TODO: add possibily to choose amount of ram +function enableTmpRAM () { + runCmd "echo 'tmpfs /tmp tmpfs defaults,size=2g 0 0' | sudo tee -a /etc/fstab" \ + "enabling /tmp in RAM by modifying /etc/fstab" + if (whiptail --title "/tmp in RAM - Reboot" --yesno "Reboot required, proceed now ?" 10 60) then + sudo reboot + fi +} + +# +# add screenfetch exec in .bashrc +# +function addScreenfetchBashrc () { + checkAndInstallDep apt screenfetch screenfetch + runCmd "touch /home/$myHomedir/.bashrc" \ + "creating .bashrc file if necessary" \ + runCmd "echo 'screenfetch -t' | tee -a /home/$myHomedir/.bashrc" \ + "adding screenfetch to .bashrc" +} + +# +# cli history cmd timestamp enable +# +function enableHistoryTS () { + typeset ret_code + printf "enabling CLI History TimeStamp " + echo "export HISTTIMEFORMAT='%F %T '" | tee -a /home/$myHomedir/.bashrc &>> $logFile + ret_code=$? + retCode $ret_code +} + +# +# install/enable auto install of security updates +# +function installUnattendedUpgrades () { + installPackage apt unattended-upgrades +} + +# +# display useful system/hardware informations +# +function toolInxi () { + checkAndInstallDep apt inxi inxi \ + && inxi -F +} + +# +# check bandwith and latency of the internet connection +# +function toolSpeedtestCli () { + checkAndInstallDep pip speedtest-cli speedtest-cli \ + && speedtest-cli +} + +# +# check for packet loss +# +function toolPacketLoss () { + ping -q -c 10 google.com +} + +# +# Optimization of SQLite databases of Firefox and Firefox Nightly +# +function toolOptimizeFirefox () { + if (whiptail --title "Firefox SQLite DB Optimization" --yesno "Terminate Firefox and proceed ?" 10 60) then + if which firefox >/dev/null; then + printf "Optimizing Firefox" + pkill -9 firefox + for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM; REINDEX;'; done + printf "\n" + fi + if which firefox-trunk >/dev/null; then + printf "Optimizing Firefox Nightly" + pkill -9 firefox-trunk + for f in ~/.mozilla/firefox-trunk/*/*.sqlite; do sqlite3 $f 'VACUUM; REINDEX;'; done + printf "\n" + fi + fi +} + +# +# remove useless packages (depedencies) +# +function toolAutoremove () { + runCmd "sudo apt-get -y autoremove" \ + "removing not necessary dependencies" +} + +# +# remove old versions of installed kernels +# +function toolClearOldKernels () { + checkAndInstallDep apt ukuu ukuu \ + && runCmd "sudo ukuu --purge-old-kernels --yes" \ + "removing old kernels" +} + +# +# force soundcards detection +# +function toolSoundCardsDetection () { + runCmd "sudo alsa force-reload" \ + "detecting ALSA sound cards" +} \ No newline at end of file diff --git a/yggdrasil.sh b/yggdrasil.sh index 6a12f10..e43bd9e 100755 --- a/yggdrasil.sh +++ b/yggdrasil.sh @@ -12,11 +12,23 @@ # dir=$(dirname $0) source /opt/yggdrasil/vars.sh -source /opt/yggdrasil/core_functions.sh -source /opt/yggdrasil/repo_functions.sh -source /opt/yggdrasil/install_functions.sh -source /opt/yggdrasil/menus_functions.sh -source /opt/yggdrasil/tools_functions.sh + +OS=`lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}'` +if [[ $OS == *"Linux Mint 18"* ]]; then + source /opt/yggdrasil/core_functions_ub1604.sh + source /opt/yggdrasil/repo_functions_ub1604.sh + source /opt/yggdrasil/install_functions_ub1604.sh + source /opt/yggdrasil/menus_functions_ub1604.sh + source /opt/yggdrasil/tools_functions_ub1604.sh +elif [[ $OS == *"Ubuntu 18.04 LTS"* ]]; then + source /opt/yggdrasil/core_functions_ub1804.sh + source /opt/yggdrasil/repo_functions_ub1804.sh + source /opt/yggdrasil/install_functions_ub1804.sh + source /opt/yggdrasil/menus_functions_ub1804.sh + source /opt/yggdrasil/tools_functions_ub1804.sh +else + return 1 +fi # # check if the script is running in root/sudo