diff --git a/019-Installing_Homebrew.sh b/019-Installing_Homebrew.sh new file mode 100644 index 0000000..5adb859 --- /dev/null +++ b/019-Installing_Homebrew.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +## Script Location +SCRIPTDIR=$(dirname $0) +source "$SCRIPTDIR/common/colors.sh" +source "$SCRIPTDIR/common/functions.sh" +source "$SCRIPTDIR/common/load-defaults.sh" + +NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" diff --git a/019-Installing_Nix_Package_Manager b/019-Installing_Nix_Package_Manager new file mode 100644 index 0000000..e918d45 --- /dev/null +++ b/019-Installing_Nix_Package_Manager @@ -0,0 +1,9 @@ +#!/bin/bash + +## Script Location +SCRIPTDIR=$(dirname $0) +source "$SCRIPTDIR/common/colors.sh" +source "$SCRIPTDIR/common/functions.sh" +source "$SCRIPTDIR/common/load-defaults.sh" + +sh <(curl -L https://nixos.org/nix/install) --daemon --yes diff --git a/022-Fastfetch-Ubuntu_Repo.sh b/022-Fastfetch-Ubuntu_Repo.sh new file mode 100644 index 0000000..690d547 --- /dev/null +++ b/022-Fastfetch-Ubuntu_Repo.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +## Script Location +SCRIPTDIR=$(dirname $0) +source "$SCRIPTDIR/common/colors.sh" +source "$SCRIPTDIR/common/functions.sh" +source "$SCRIPTDIR/common/load-defaults.sh" + +if [ get_distro == *"Ubuntu"* ] +then + ppa_added=`grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -v list.save | grep -v deb-src | grep deb | grep fastfetch | wc -l` + if $ppa_added + then + echo "fastfetch ppa already installed" + else + sudo add-apt-repository ppa:zhangsongcui3371/fastfetch + fi +fi diff --git a/025-Unattended_Upgrades.sh b/023-Unattended_Upgrades.sh similarity index 100% rename from 025-Unattended_Upgrades.sh rename to 023-Unattended_Upgrades.sh diff --git a/024-Checking_and_Installing_Dependencies_via_Package_Manager.sh b/024-Checking_and_Installing_Dependencies_via_Package_Manager.sh new file mode 100644 index 0000000..b95a3cb --- /dev/null +++ b/024-Checking_and_Installing_Dependencies_via_Package_Manager.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +## Script Location +SCRIPTDIR=$(dirname $0) +source "$SCRIPTDIR/common/colors.sh" +source "$SCRIPTDIR/common/functions.sh" +source "$SCRIPTDIR/common/load-defaults.sh" + +install_dependencies() { + ## Start File Loop + ## For .dependency files In The dependencies Directory + DEPENDENCIESALL="$SCRIPTDIR/dependencies/package_manager/*.dep" + for f in $DEPENDENCIESALL + do + + ## Name Of Package + DEPENDENCYCOMMAND=$(echo "`basename $f | cut -f 1 -d '.'`") + + ## Actual Package + DEPENDENCYPACKAGE=`cat $f` + + printf "$COL_LIGHT_BLUE" "* Checking For command $DEPENDENCYCOMMAND with package name $DEPENDENCYPACKAGE" + + if is_command $DEPENDENCYCOMMAND; + then + printf "$COL_YELLOW" "** $DEPENDENCYCOMMAND Is Already Installed." + + else + printf "$COL_YELLOW" "** Installing $DEPENDENCYCOMMAND" + pkg_mgr_install_pkg $DEPENDENCYPACKAGE + + if is_command $DEPENDENCYCOMMAND; + then + printf "$COL_GREEN" "** $DEPENDENCYCOMMAND Installation Success" + else + printf "$COL_RED" "** Error Installing $DEPENDENCYCOMMAND" + fi + + fi + ## End Of loop + done +} + +pkgmgr_update +install_dependencies diff --git a/025-Checking_and_Installing_Dependencies_via_Homebrew.sh b/025-Checking_and_Installing_Dependencies_via_Homebrew.sh new file mode 100644 index 0000000..55751c1 --- /dev/null +++ b/025-Checking_and_Installing_Dependencies_via_Homebrew.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +## Script Location +SCRIPTDIR=$(dirname $0) +source "$SCRIPTDIR/common/colors.sh" +source "$SCRIPTDIR/common/functions.sh" +source "$SCRIPTDIR/common/load-defaults.sh" + +install_dependencies() { + ## Start File Loop + ## For .dependency files In The dependencies Directory + DEPENDENCIESALL="$SCRIPTDIR/dependencies/homebrew/*.dep" + for f in $DEPENDENCIESALL + do + + ## Name Of Package + DEPENDENCYCOMMAND=$(echo "`basename $f | cut -f 1 -d '.'`") + + ## Actual Package + DEPENDENCYPACKAGE=`cat $f` + + printf "$COL_LIGHT_BLUE" "* Checking For command $DEPENDENCYCOMMAND with package name $DEPENDENCYPACKAGE" + + if is_command $DEPENDENCYCOMMAND; + then + printf "$COL_YELLOW" "** $DEPENDENCYCOMMAND Is Already Installed." + + else + printf "$COL_YELLOW" "** Installing $DEPENDENCYCOMMAND" + yes | brew install $DEPENDENCYPACKAGE + + if is_command $DEPENDENCYCOMMAND; + then + printf "$COL_GREEN" "** $DEPENDENCYCOMMAND Installation Success" + else + printf "$COL_RED" "** Error Installing $DEPENDENCYCOMMAND" + fi + + fi + ## End Of loop + done +} + + +install_dependencies diff --git a/024-Checking_Dependencies.sh b/025-Checking_and_Installing_Dependencies_via_Nix similarity index 91% rename from 024-Checking_Dependencies.sh rename to 025-Checking_and_Installing_Dependencies_via_Nix index 8a02260..c7cb4bf 100644 --- a/024-Checking_Dependencies.sh +++ b/025-Checking_and_Installing_Dependencies_via_Nix @@ -9,7 +9,7 @@ source "$SCRIPTDIR/common/load-defaults.sh" install_dependencies() { ## Start File Loop ## For .dependency files In The dependencies Directory - DEPENDENCIESALL="$SCRIPTDIR/dependencies/*.dep" + DEPENDENCIESALL="$SCRIPTDIR/dependencies/homebrew/*.dep" for f in $DEPENDENCIESALL do @@ -27,7 +27,7 @@ install_dependencies() { else printf "$COL_YELLOW" "** Installing $DEPENDENCYCOMMAND" - install_pkg $DEPENDENCYPACKAGE + nix-env -iA $DEPENDENCYPACKAGE if is_command $DEPENDENCYCOMMAND; then @@ -41,5 +41,5 @@ install_dependencies() { done } -pkgmgr_update + install_dependencies diff --git a/common/functions.sh b/common/functions.sh index af28c2c..f7b888f 100644 --- a/common/functions.sh +++ b/common/functions.sh @@ -36,6 +36,10 @@ should_apt_last_update() { fi } +get_distro() { + echo $(awk -F= '/^NAME/{print $2}' /etc/os-release) +} + get_pkg_mgr() { if is_command apt ; then echo "apt" @@ -127,8 +131,7 @@ pkgmgr_clean(){ } - -install_pkg() { +pkg_mgr_install_pkg() { # package to install local pkg_to_install="$1" diff --git a/dependencies/fastfetch.dep b/dependencies/homebrew/fastfetch.dep similarity index 100% rename from dependencies/fastfetch.dep rename to dependencies/homebrew/fastfetch.dep diff --git a/dependencies/curl.dep b/dependencies/package_manager/curl.dep similarity index 100% rename from dependencies/curl.dep rename to dependencies/package_manager/curl.dep diff --git a/dependencies/package_manager/fastfetch.dep b/dependencies/package_manager/fastfetch.dep new file mode 100644 index 0000000..215b1e7 --- /dev/null +++ b/dependencies/package_manager/fastfetch.dep @@ -0,0 +1 @@ +fastfetch diff --git a/dependencies/git.dep b/dependencies/package_manager/git.dep similarity index 100% rename from dependencies/git.dep rename to dependencies/package_manager/git.dep diff --git a/dependencies/grep.dep b/dependencies/package_manager/grep.dep similarity index 100% rename from dependencies/grep.dep rename to dependencies/package_manager/grep.dep diff --git a/dependencies/ipa-client-install.dep b/dependencies/package_manager/ipa-client-install.dep similarity index 100% rename from dependencies/ipa-client-install.dep rename to dependencies/package_manager/ipa-client-install.dep diff --git a/dependencies/jq.dep b/dependencies/package_manager/jq.dep similarity index 100% rename from dependencies/jq.dep rename to dependencies/package_manager/jq.dep diff --git a/dependencies/ncdu.dep b/dependencies/package_manager/ncdu.dep similarity index 100% rename from dependencies/ncdu.dep rename to dependencies/package_manager/ncdu.dep diff --git a/dependencies/sed.dep b/dependencies/package_manager/sed.dep similarity index 100% rename from dependencies/sed.dep rename to dependencies/package_manager/sed.dep diff --git a/dependencies/software-properties-common.dep b/dependencies/package_manager/software-properties-common.dep similarity index 100% rename from dependencies/software-properties-common.dep rename to dependencies/package_manager/software-properties-common.dep diff --git a/dependencies/tar.dep b/dependencies/package_manager/tar.dep similarity index 100% rename from dependencies/tar.dep rename to dependencies/package_manager/tar.dep diff --git a/dependencies/unattended-upgrades.dep b/dependencies/package_manager/unattended-upgrades.dep similarity index 100% rename from dependencies/unattended-upgrades.dep rename to dependencies/package_manager/unattended-upgrades.dep diff --git a/dependencies/wget.dep b/dependencies/package_manager/wget.dep similarity index 100% rename from dependencies/wget.dep rename to dependencies/package_manager/wget.dep diff --git a/dependencies/whiptail.dep b/dependencies/package_manager/whiptail.dep similarity index 100% rename from dependencies/whiptail.dep rename to dependencies/package_manager/whiptail.dep diff --git a/install/install.sh b/install/install.sh index c0f655b..2e2b72a 100644 --- a/install/install.sh +++ b/install/install.sh @@ -49,7 +49,7 @@ get_pkg_mgr() { fi } -install_pkg() { +pkg_mgr_install_pkg() { # package to install local pkg_to_install="$1" @@ -76,7 +76,7 @@ then printf "$COL_YELLOW" "* git Is Already Installed." else printf "$COL_YELLOW" "* Installing git" - install_pkg git + pkg_mgr_install_pkg git fi printf "$COL_LIGHT_BLUE" "Checking for installation script"