From 64a0cfae326e9fa3e3b240220c9dfd46434a4ecd Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 1 Jan 2024 21:09:12 +0900 Subject: [PATCH] updated --- CHANGELOGS.md | 3 ++ install-scripts/00-base.sh | 40 +++++++++++++- install-scripts/00-hypr-pkgs.sh | 59 ++++++++++++++++++++- install-scripts/Global_functions.sh | 82 ----------------------------- install-scripts/InputGroup.sh | 20 ++++++- install-scripts/bluetooth.sh | 42 ++++++++++++++- install-scripts/dotfiles.sh | 18 ++++++- install-scripts/gtk_themes.sh | 42 ++++++++++++++- install-scripts/hyprland.sh | 40 +++++++++++++- install-scripts/nvidia.sh | 41 ++++++++++++++- install-scripts/paru.sh | 20 ++++++- install-scripts/pipewire.sh | 40 +++++++++++++- install-scripts/rog.sh | 42 ++++++++++++++- install-scripts/sddm.sh | 41 ++++++++++++++- install-scripts/thunar.sh | 40 +++++++++++++- install-scripts/xdph.sh | 40 +++++++++++++- install-scripts/yay.sh | 20 ++++++- install-scripts/zsh.sh | 41 ++++++++++++++- 18 files changed, 562 insertions(+), 109 deletions(-) delete mode 100755 install-scripts/Global_functions.sh diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 247b147..8a5654a 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,5 +1,8 @@ ## Changelogs +## 30 Dec 2023 +- Install scripts reconstructed + ## 29 December 2023 - Remove dunst in favor of swaync. NOTE: Part of the script is to also uninstall mako and dunst (if installed) as on my experience, dunst is sometimes taking over the notification even if it is not set to start diff --git a/install-scripts/00-base.sh b/install-scripts/00-base.sh index 21cf82f..8a7baa6 100755 --- a/install-scripts/00-base.sh +++ b/install-scripts/00-base.sh @@ -14,12 +14,48 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_base.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +## Function for installing packages +install_package_pacman() { + # Checking if package is already installed + if pacman -Q "$1" &>/dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + sudo pacman -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if pacman -Q "$1" &>/dev/null ; then + echo -e "${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "${ERROR} $1 failed to install. Please check the $LOG. You may need to install manually." + exit 1 + fi + fi +} + # Installation of main components printf "\n%s - Installing base-devel \n" "${NOTE}" diff --git a/install-scripts/00-hypr-pkgs.sh b/install-scripts/00-hypr-pkgs.sh index a5554f8..6f269f9 100755 --- a/install-scripts/00-hypr-pkgs.sh +++ b/install-scripts/00-hypr-pkgs.sh @@ -91,11 +91,66 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypr-pkgs.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + +# Function for uninstalling packages +uninstall_package() { + # Checking if package is installed + if pacman -Qi "$1" &>> /dev/null ; then + # Package is installed + echo -e "${NOTE} Uninstalling $1 ..." + sudo pacman -Rns --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is uninstalled + if ! pacman -Qi "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was uninstalled." + else + # Something went wrong, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to uninstall. Please check the log." + exit 1 + fi + fi +} # Installation of main components printf "\n%s - Installing hyprland packages.... \n" "${NOTE}" diff --git a/install-scripts/Global_functions.sh b/install-scripts/Global_functions.sh deleted file mode 100755 index 133b7ff..0000000 --- a/install-scripts/Global_functions.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# 💫 https://github.com/JaKooLit 💫 # -# Global Functions for Scripts # - -set -e - -# Set some colors for output messages -OK="$(tput setaf 2)[OK]$(tput sgr0)" -ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" -NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" -WARN="$(tput setaf 166)[WARN]$(tput sgr0)" -CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" -ORANGE=$(tput setaf 166) -YELLOW=$(tput setaf 3) -RESET=$(tput sgr0) - - -# Create Directory for Install Logs -if [ ! -d Install-Logs ]; then - mkdir Install-Logs -fi - -# Function for installing packages -install_package_pacman() { - # Checking if package is already installed - if pacman -Q "$1" &>/dev/null ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo pacman -S --noconfirm "$1" 2>&1 | tee -a "$LOG" - # Making sure package is installed - if pacman -Q "$1" &>/dev/null ; then - echo -e "${OK} $1 was installed." - else - # Something is missing, exiting to review log - echo -e "${ERROR} $1 failed to install. Please check the $LOG. You may need to install manually." - exit 1 - fi - fi -} - - -ISAUR=$(command -v yay || command -v paru) - -# Function for installing packages -install_package() { - # Checking if package is already installed - if $ISAUR -Q "$1" &>> /dev/null ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" - # Making sure package is installed - if $ISAUR -Q "$1" &>> /dev/null ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review log - echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" - exit 1 - fi - fi -} - -# Function for uninstalling packages -uninstall_package() { - # Checking if package is installed - if pacman -Qi "$1" &>> /dev/null ; then - # Package is installed - echo -e "${NOTE} Uninstalling $1 ..." - sudo pacman -Rns --noconfirm "$1" 2>&1 | tee -a "$LOG" - # Making sure package is uninstalled - if ! pacman -Qi "$1" &>> /dev/null ; then - echo -e "\e[1A\e[K${OK} $1 was uninstalled." - else - # Something went wrong, exiting to review log - echo -e "\e[1A\e[K${ERROR} $1 failed to uninstall. Please check the log." - exit 1 - fi - fi -} \ No newline at end of file diff --git a/install-scripts/InputGroup.sh b/install-scripts/InputGroup.sh index b98c995..6f3e826 100755 --- a/install-scripts/InputGroup.sh +++ b/install-scripts/InputGroup.sh @@ -11,11 +11,27 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_input.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + while true; do echo "${WARN} This script will add or remove your user from the 'input' group." echo "${NOTE} Please note that adding yourself to the 'input' group might be necessary for waybar keyboard-state functionality." diff --git a/install-scripts/bluetooth.sh b/install-scripts/bluetooth.sh index 4eafee4..0f1a9ec 100755 --- a/install-scripts/bluetooth.sh +++ b/install-scripts/bluetooth.sh @@ -16,11 +16,49 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_bluetooth.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + # Bluetooth printf "${NOTE} Installing Bluetooth Packages...\n" for BLUE in "${blue[@]}"; do diff --git a/install-scripts/dotfiles.sh b/install-scripts/dotfiles.sh index 75576d6..531aae4 100755 --- a/install-scripts/dotfiles.sh +++ b/install-scripts/dotfiles.sh @@ -4,7 +4,23 @@ ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi printf "${NOTE} Downloading / Checking for existing Hyprland-Dots.tar.gz...\n" diff --git a/install-scripts/gtk_themes.sh b/install-scripts/gtk_themes.sh index b384462..9c41055 100755 --- a/install-scripts/gtk_themes.sh +++ b/install-scripts/gtk_themes.sh @@ -16,11 +16,49 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_themes.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + # installing engine needed for gtk themes for PKG1 in "${engine[@]}"; do diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh index 389dccb..687d7c5 100755 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -18,7 +18,45 @@ cd "$PARENT_DIR" || exit 1 # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland.log" -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} # Removing other Hyprland to avoid conflict printf "${YELLOW} Checking for other hyprland packages and remove if any..${RESET}\n" diff --git a/install-scripts/nvidia.sh b/install-scripts/nvidia.sh index 413fd7f..7bb44e0 100755 --- a/install-scripts/nvidia.sh +++ b/install-scripts/nvidia.sh @@ -22,11 +22,48 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_nvidia.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} # nvidia stuff printf "${YELLOW} Checking for other hyprland packages and remove if any..${RESET}\n" diff --git a/install-scripts/paru.sh b/install-scripts/paru.sh index cf9cbc2..b0dccd0 100755 --- a/install-scripts/paru.sh +++ b/install-scripts/paru.sh @@ -12,11 +12,27 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_paru.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + # Check for AUR helper and install if not found ISAUR=$(command -v yay || command -v paru) diff --git a/install-scripts/pipewire.sh b/install-scripts/pipewire.sh index 3ea0232..918c246 100755 --- a/install-scripts/pipewire.sh +++ b/install-scripts/pipewire.sh @@ -19,13 +19,49 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_pipewire.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + ISAUR=$(command -v yay || command -v paru) +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + # Removal of pulseaudio printf "${YELLOW}Removing pulseaudio stuff...${RESET}\n" for pulseaudio in pulseaudio pulseaudio-alsa pulseaudio-bluetooth; do diff --git a/install-scripts/rog.sh b/install-scripts/rog.sh index fad133d..59acca0 100755 --- a/install-scripts/rog.sh +++ b/install-scripts/rog.sh @@ -10,11 +10,49 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_rog.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + ### Install software for Asus ROG laptops ### printf " Installing ASUS ROG packages...\n" diff --git a/install-scripts/sddm.sh b/install-scripts/sddm.sh index a72e95e..9a21ef8 100755 --- a/install-scripts/sddm.sh +++ b/install-scripts/sddm.sh @@ -18,11 +18,48 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + + +ISAUR=$(command -v yay || command -v paru) +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} # SDDM # Check if SDDM is already installed diff --git a/install-scripts/thunar.sh b/install-scripts/thunar.sh index 04f9524..af66b53 100755 --- a/install-scripts/thunar.sh +++ b/install-scripts/thunar.sh @@ -19,11 +19,49 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_thunar.log" +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + # Thunar printf "${NOTE} Installing Thunar Packages...\n" for THUNAR in "${thunar[@]}"; do diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh index 3a2ee1a..e139a64 100755 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -16,11 +16,49 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_xdph.log" +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + # XDG-DESKTOP-PORTAL-HYPRLAND for xdgs in "${xdg[@]}"; do install_package "$xdgs" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/yay.sh b/install-scripts/yay.sh index fb1f910..222f25d 100755 --- a/install-scripts/yay.sh +++ b/install-scripts/yay.sh @@ -12,11 +12,27 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" - # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_yay.log" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + # Check for AUR helper and install if not found ISAUR=$(command -v yay || command -v paru) diff --git a/install-scripts/zsh.sh b/install-scripts/zsh.sh index cbbf853..3db16ce 100755 --- a/install-scripts/zsh.sh +++ b/install-scripts/zsh.sh @@ -16,11 +16,50 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +set -e + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +WARN="$(tput setaf 166)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +ORANGE=$(tput setaf 166) +YELLOW=$(tput setaf 3) +RESET=$(tput sgr0) + + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_zsh.log" +ISAUR=$(command -v yay || command -v paru) + +# Function for installing packages +install_package() { + # Checking if package is already installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + $ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG" + # Making sure package is installed + if $ISAUR -Q "$1" &>> /dev/null ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review log + echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :(" + exit 1 + fi + fi +} + ## Optional Pokemon color scripts while true; do read -p "${CAT} OPTIONAL - Do you want to add Pokemon color scripts? (y/n): " choice