From 2e85f93f303ecd526eaca1bce01034f5ad58a4f5 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 28 Feb 2025 01:09:22 +0900 Subject: [PATCH] Initial push for whiptail --- install-scripts/00-hypr-pkgs.sh | 9 +- install-scripts/02-Final-Check.sh | 6 +- install-scripts/InputGroup.sh | 9 +- install-scripts/ags.sh | 9 +- install-scripts/bluetooth.sh | 9 +- install-scripts/copr.sh | 11 +- install-scripts/dotfiles-main.sh | 11 +- install-scripts/fonts.sh | 9 +- install-scripts/gtk_themes.sh | 10 +- install-scripts/hyprland.sh | 9 +- install-scripts/nvidia.sh | 9 +- install-scripts/rog.sh | 10 +- install-scripts/sddm.sh | 9 +- install-scripts/sddm_theme.sh | 9 +- install-scripts/thunar.sh | 10 +- install-scripts/thunar_default.sh | 10 +- install-scripts/xdph.sh | 11 +- install-scripts/zsh.sh | 9 +- install-scripts/zsh_pokemon.sh | 9 +- install.sh | 410 +++++++++++++++++------------- preset.sh | 44 ++-- 21 files changed, 368 insertions(+), 264 deletions(-) diff --git a/install-scripts/00-hypr-pkgs.sh b/install-scripts/00-hypr-pkgs.sh index d25dcb2..3edc0bc 100755 --- a/install-scripts/00-hypr-pkgs.sh +++ b/install-scripts/00-hypr-pkgs.sh @@ -87,14 +87,17 @@ uninstall=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # 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" diff --git a/install-scripts/02-Final-Check.sh b/install-scripts/02-Final-Check.sh index 073493f..7c51e42 100644 --- a/install-scripts/02-Final-Check.sh +++ b/install-scripts/02-Final-Check.sh @@ -27,7 +27,6 @@ local_pkgs_installed=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script @@ -35,7 +34,10 @@ PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } # Source the global functions script -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Set the name of the log file to include the current date and time LOG="Install-Logs/00_CHECK-$(date +%d-%H%M%S)_installed.log" diff --git a/install-scripts/InputGroup.sh b/install-scripts/InputGroup.sh index 71f9459..afe0fc8 100755 --- a/install-scripts/InputGroup.sh +++ b/install-scripts/InputGroup.sh @@ -3,14 +3,17 @@ # Adding users into input group # ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # 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" diff --git a/install-scripts/ags.sh b/install-scripts/ags.sh index c464c54..da01e8c 100755 --- a/install-scripts/ags.sh +++ b/install-scripts/ags.sh @@ -26,14 +26,17 @@ ags=( ags_tag="v1.9.0" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_ags.log" diff --git a/install-scripts/bluetooth.sh b/install-scripts/bluetooth.sh index 70b8d62..5634a8f 100755 --- a/install-scripts/bluetooth.sh +++ b/install-scripts/bluetooth.sh @@ -11,14 +11,17 @@ blue=( ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # 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" diff --git a/install-scripts/copr.sh b/install-scripts/copr.sh index bc55017..4e7e51e 100755 --- a/install-scripts/copr.sh +++ b/install-scripts/copr.sh @@ -16,15 +16,18 @@ COPR_REPOS=( tofik/nwg-shell ) -# Determine the directory where the script is located +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -# Source external functions -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Set the name of the log file LOG="Install-Logs/install-$(date +%d-%H%M%S)_copr.log" diff --git a/install-scripts/dotfiles-main.sh b/install-scripts/dotfiles-main.sh index 60cf064..cd737b2 100644 --- a/install-scripts/dotfiles-main.sh +++ b/install-scripts/dotfiles-main.sh @@ -3,8 +3,17 @@ # Hyprland-Dots to download from main # ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Change the working directory to the parent directory of the script +PARENT_DIR="$SCRIPT_DIR/.." +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } + +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi printf "${NOTE} Cloning and Installing ${SKY_BLUE}KooL's Hyprland Dots${RESET}....\n" diff --git a/install-scripts/fonts.sh b/install-scripts/fonts.sh index 331c613..ea6d083 100755 --- a/install-scripts/fonts.sh +++ b/install-scripts/fonts.sh @@ -14,14 +14,17 @@ fonts=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_fonts.log" diff --git a/install-scripts/gtk_themes.sh b/install-scripts/gtk_themes.sh index d56796d..213e75c 100755 --- a/install-scripts/gtk_themes.sh +++ b/install-scripts/gtk_themes.sh @@ -8,15 +8,17 @@ engine=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## - -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # 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" diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh index e374323..4011a2d 100755 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -10,14 +10,17 @@ hypr=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Create Directory for Install Logs diff --git a/install-scripts/nvidia.sh b/install-scripts/nvidia.sh index 3f15d66..5de8098 100755 --- a/install-scripts/nvidia.sh +++ b/install-scripts/nvidia.sh @@ -10,14 +10,17 @@ nvidia_pkg=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Create Directory for Install Logs diff --git a/install-scripts/rog.sh b/install-scripts/rog.sh index b075abe..e07e6bb 100755 --- a/install-scripts/rog.sh +++ b/install-scripts/rog.sh @@ -9,16 +9,18 @@ asusctl=( tuned-ppd ) - ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # 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" diff --git a/install-scripts/sddm.sh b/install-scripts/sddm.sh index 2845883..b916d85 100755 --- a/install-scripts/sddm.sh +++ b/install-scripts/sddm.sh @@ -19,14 +19,17 @@ login=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # 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" diff --git a/install-scripts/sddm_theme.sh b/install-scripts/sddm_theme.sh index 67fe0bb..87727f0 100755 --- a/install-scripts/sddm_theme.sh +++ b/install-scripts/sddm_theme.sh @@ -6,14 +6,17 @@ source_theme="https://codeberg.org/JaKooLit/sddm-sequoia" theme_name="sequoia_2" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +fi # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm_theme.log" diff --git a/install-scripts/thunar.sh b/install-scripts/thunar.sh index 9d22164..fa5e101 100755 --- a/install-scripts/thunar.sh +++ b/install-scripts/thunar.sh @@ -12,15 +12,17 @@ thunar=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## - -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +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" diff --git a/install-scripts/thunar_default.sh b/install-scripts/thunar_default.sh index 576e76c..463a69a 100755 --- a/install-scripts/thunar_default.sh +++ b/install-scripts/thunar_default.sh @@ -2,16 +2,18 @@ # 💫 https://github.com/JaKooLit 💫 # # Thunar-default # - ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +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-default.log" diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh index 541fc90..5e8ab8c 100755 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -7,17 +7,18 @@ xdg=( xdg-desktop-portal-gtk ) - ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## - -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +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" diff --git a/install-scripts/zsh.sh b/install-scripts/zsh.sh index 541a3a9..bbfef85 100755 --- a/install-scripts/zsh.sh +++ b/install-scripts/zsh.sh @@ -10,14 +10,17 @@ zsh=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +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" diff --git a/install-scripts/zsh_pokemon.sh b/install-scripts/zsh_pokemon.sh index 418e61d..639b628 100755 --- a/install-scripts/zsh_pokemon.sh +++ b/install-scripts/zsh_pokemon.sh @@ -7,14 +7,17 @@ poke=( ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## -# Determine the directory where the script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Change the working directory to the parent directory of the script PARENT_DIR="$SCRIPT_DIR/.." -cd "$PARENT_DIR" || exit 1 +cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } -source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" +# Source the global functions script +if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then + echo "Failed to source Global_functions.sh" + exit 1 +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_pokemon.log" diff --git a/install.sh b/install.sh index b29ccda..3cb9367 100755 --- a/install.sh +++ b/install.sh @@ -47,25 +47,24 @@ echo -e "\e[35m \e[0m" printf "\n%.0s" {1..1} -# Welcome message -echo "${SKY_BLUE}Welcome to KooL's Fedora-Hyprland (2025) Install Script!${RESET}" -echo -echo "${WARNING}ATTENTION: Run a full system update and Reboot first!! (Highly Recommended) ${RESET}" -echo -echo "${YELLOW}NOTE: You will be required to answer some questions during the installation! ${RESET}" -echo -echo "${YELLOW}NOTE: If you are installing on a VM, ensure to enable 3D acceleration else Hyprland wont start! ${RESET}" -echo +# Welcome message using whiptail (for displaying information) +whiptail --title "KooL Fedora-Hyprland (2025) Install Script" \ + --msgbox "Welcome to KooL Fedora-Hyprland (2025) Install Script!!!\n\n\ +ATTENTION: Run a full system update and Reboot first !!! (Highly Recommended)\n\n\ +NOTE: If you are installing on a VM, ensure to enable 3D acceleration else Hyprland may NOT start!" \ + 15 80 -read -p "$(tput setaf 6)Would you like to proceed? (y/n): $(tput sgr0)" proceed - -if [ "$proceed" != "y" ]; then - printf "\n%.0s" {1..2} - echo "${INFO} Installation aborted. ${SKY_BLUE}No changes in your system.${RESET} ${YELLOW}Goodbye!${RESET}" - printf "\n%.0s" {1..2} +# Ask if the user wants to proceed +if ! whiptail --title "Proceed with Installation?" \ + --yesno "Would you like to proceed?" 7 50; then + echo -e "\n" + echo "❌ ${INFO} You 🫵 chose ${YELLOW}NOT${RESET} to proceed. ${YELLOW}Exiting...${RESET}" + echo -e "\n" exit 1 fi +echo "👌 ${OK} 🇵🇭 ${MAGENTA}KooL..${RESET} ${SKY_BLUE}lets continue with the installation...${RESET}" + printf "\n%.0s" {1..1} # install pciutils if detected not installed. Necessary for detecting GPU @@ -75,64 +74,23 @@ if ! rpm -q pciutils > /dev/null; then printf "\n%.0s" {1..1} fi +if ! command -v whiptail >/dev/null; then + echo "${NOTE} - whiptail is not installed. Installing..." + sudo dnf install -y whiptail + printf "\n%.0s" {1..1} +fi + +# Set the name of the log file to include the current date and time +LOG="install-$(date +%d-%H%M%S).log" + # Create Directory for Install Logs if [ ! -d Install-Logs ]; then mkdir Install-Logs fi - -# Function to colorize prompts -colorize_prompt() { - local color="$1" - local message="$2" - echo -n "${color}${message}$(tput sgr0)" -} - -# Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S).log" - -# Define the directory where your scripts are located +# Path to the install-scripts directory script_directory=install-scripts -# Function to ask a yes/no question and set the response in a variable -ask_yes_no() { - if [[ ! -z "${!2}" ]]; then - echo "$(colorize_prompt "$CAT" "$1 (Preset): ${!2}")" - if [[ "${!2}" = [Yy] ]]; then - return 0 - else - return 1 - fi - else - eval "$2=''" - fi - while true; do - read -p "$(colorize_prompt "$CAT" "$1 (y/n): ")" choice - case "$choice" in - [Yy]* ) eval "$2='Y'"; return 0;; - [Nn]* ) eval "$2='N'"; return 1;; - * ) echo "Please answer with y or n.";; - esac - done -} - -# Function to ask a custom question with specific options and set the response in a variable -ask_custom_option() { - local prompt="$1" - local valid_options="$2" - local response_var="$3" - - while true; do - read -p "$(colorize_prompt "$CAT" "$prompt ($valid_options): ")" choice - if [[ " $valid_options " == *" $choice "* ]]; then - eval "$response_var='$choice'" - return 0 - else - echo "Please choose one of the provided options: $valid_options" - fi - done -} - # Function to execute a script if it exists and make it executable execute_script() { local script="$1" @@ -140,7 +98,7 @@ execute_script() { if [ -f "$script_path" ]; then chmod +x "$script_path" if [ -x "$script_path" ]; then - env USE_PRESET=$use_preset "$script_path" + env "$script_path" else echo "Failed to make script '$script' executable." fi @@ -149,138 +107,230 @@ execute_script() { fi } -# Collect user responses to all questions -# Check if nvidia is present -if lspci | grep -i "nvidia" &> /dev/null; then - printf "\n" - printf "${INFO} ${YELLOW}NVIDIA GPU${RESET} detected in your system \n" - ask_yes_no "-Do you want script to configure ${YELLOW}NVIDIA${RESET} for you?" nvidia +################# +## Default values for the options (will be overwritten by preset file if available) +gtk_themes="OFF" +bluetooth="OFF" +thunar="OFF" +ags="OFF" +sddm="OFF" +sddm_theme="OFF" +xdph="OFF" +zsh="OFF" +pokemon="OFF" +rog="OFF" +dots="OFF" +input_group="OFF" +nvidia="OFF" +nouveau="OFF" + +# Function to load preset file +load_preset() { + if [ -f "$1" ]; then + echo "✅ Loading preset: $1" + source "$1" + else + echo "⚠️ Preset file not found: $1. Using default values." + fi +} + +# Check if --preset argument is passed +if [[ "$1" == "--preset" && -n "$2" ]]; then + load_preset "$2" fi -printf "\n" -ask_yes_no "-Install ${YELLOW}GTK themes${RESET} (required for Dark/Light function)?" gtk_themes +# List of services to check for active login managers +services=("gdm.service" "gdm3.service" "lightdm.service" "lxdm.service") -printf "\n" -ask_yes_no "-Do you want to configure ${YELLOW}Bluetooth${RESET}?" bluetooth - -printf "\n" -ask_yes_no "-Do you want to install ${YELLOW}Thunar file manager${RESET}?" thunar - -if [[ "$thunar" == "Y" ]]; then - ask_yes_no "-Set ${YELLOW}Thunar${RESET} as the default file manager?" thunar_choice -fi - -# Input group -printf "\n" -if ! groups "$(whoami)" | grep -q '\binput\b'; then - printf "${NOTE} adding to ${YELLOW}input${RESET} group might be necessary for ${YELLOW}waybar keyboard-state functionality${RESET} \n" - ask_yes_no "-Would you like to be added to the ${YELLOW}input${RESET} group?" input_group -fi - -printf "\n" -printf "${NOTE} ${YELLOW}AGS Desktop Overview DEMO link${RESET} on README\n" -ask_yes_no "-Install ${YELLOW}AGS (aylur's GTK shell) v1${RESET} for Desktop-Like Overview?" ags - -printf "\n" -ask_yes_no "-Install & configure ${YELLOW}SDDM${RESET} as login manager?" sddm -# check if any known login managers are active when users choose to install sddm -if [ "$sddm" == "y" ] || [ "$sddm" == "Y" ]; then - # List of services to check - services=("gdm.service" "gdm3.service" "lightdm.service" "lxdm.service") - - # Loop through each service +# Function to check if any login services are active +check_services_running() { for svc in "${services[@]}"; do if systemctl is-active --quiet "$svc"; then - echo "${ERROR} ${MAGENTA}$svc${RESET} is active. stop or disable it first or ${YELLOW}DO NOT choose SDDM${RESET} to install." - echo "${NOTE} If you have GDM, no need to install SDDM. GDM will work fine as Login Manager for Hyprland." - printf "\n%.0s" {1..2} - exit 1 + return 0 fi done -fi -if [[ "$sddm" == "Y" ]]; then - ask_yes_no "-Download and Install ${YELLOW}SDDM Theme?${RESET} " sddm_theme + return 1 +} + +# Check if NVIDIA GPU is detected +nvidia_detected=false +if lspci | grep -i "nvidia" &> /dev/null; then + nvidia_detected=true + whiptail --title "NVIDIA GPU Detected" --msgbox "NVIDIA GPU detected in your system.\n\nNOTE: The script will install nvidia-dkms, nvidia-utils, and nvidia-settings if you choose to configure." 12 60 fi -printf "\n" -ask_yes_no "-Install ${YELLOW}XDG-DESKTOP-PORTAL-HYPRLAND?${RESET} (For proper Screen Share, e.g., OBS)" xdph +# Initialize the options array for whiptail checklist +options_command=( + whiptail --title "Select Options" --checklist "Choose options to install or configure\nNOTE: spacebar to select" 28 85 20 +) -printf "\n" -ask_yes_no "-Install ${YELLOW}zsh${RESET} with ${YELLOW}oh-my-zsh?${RESET}" zsh - -if [[ "$zsh" == "Y" ]]; then - ask_yes_no "-Add ${YELLOW}Pokemon color scripts?${RESET} in your terminal?" pokemon_choice +# Add NVIDIA options if detected +if [ "$nvidia_detected" == "true" ]; then + options_command+=( + "nvidia" "Do you want script to configure NVIDIA GPU?" "OFF" + "nouveau" "Do you want Nouveau to be blacklisted?" "OFF" + ) fi -printf "\n" -ask_yes_no "-Installing on ${YELLOW}Asus ROG laptops?${RESET}" rog +# Check if user is already in the 'input' group +input_group_detected=false +if ! groups "$(whoami)" | grep -q '\binput\b'; then + input_group_detected=true + whiptail --title "Input Group" --msgbox "You are not currently in the input group.\n\nAdding you to the input group might be necessary for the Waybar keyboard-state functionality." 12 60 +fi -printf "\n" -ask_yes_no "-Do you want to add pre-configured ${YELLOW}KooL's Hyprland dotfiles?${RESET}" dots +# Add 'input_group' option if necessary +if [ "$input_group_detected" == "true" ]; then + options_command+=( + "input_group" "Add your USER to input group for some waybar functionality?" "OFF" + ) +fi -printf "\n" +# Add the remaining static options +options_command+=( + "gtk_themes" "Install GTK themes (required for Dark/Light function)" "OFF" + "bluetooth" "Do you want script to configure Bluetooth?" "OFF" + "thunar" "Do you want Thunar file manager to be installed?" "OFF" + "ags" "Install AGS v1 for Desktop-Like Overview" "OFF" + "sddm" "Install & configure SDDM login manager?" "OFF" + "sddm_theme" "Download & Install Additional SDDM theme?" "OFF" + "xdph" "Install XDG-DESKTOP-PORTAL-HYPRLAND (for screen share)?" "OFF" + "zsh" "Install zsh shell with Oh-My-Zsh?" "OFF" + "pokemon" "Add Pokemon color scripts to your terminal?" "OFF" + "rog" "Are you installing on Asus ROG laptops?" "OFF" + "dots" "Download and install pre-configured KooL Hyprland dotfiles?" "OFF" +) -# Ensuring all in the scripts folder are made executable -chmod +x install-scripts/* +while true; do + # Execute the checklist and capture the selected options + selected_options=$("${options_command[@]}" 3>&1 1>&2 2>&3) + + # Check if the user pressed Cancel (exit status 1) + if [ $? -ne 0 ]; then + echo -e "\n" + echo "❌ ${INFO} You 🫵 cancelled the selection. ${YELLOW}Goodbye!${RESET}" + exit 0 # Exit the script if Cancel is pressed + fi + + # If no option was selected, notify and restart the selection + if [ -z "$selected_options" ]; then + whiptail --title "Warning" --msgbox "⚠️ No options were selected. Please select at least one option." 10 60 + continue # Return to selection if no options selected + fi + + # Convert selected options into an array (preserving spaces in values) + IFS=' ' read -r -a options <<< "$selected_options" + + # Prepare Confirmation Message + confirm_message="You have selected the following options:\n\n" + for option in "${options[@]}"; do + confirm_message+=" - $option\n" + done + confirm_message+="\nAre you happy with these choices?" + + # onfirmation prompt + if ! whiptail --title "Confirm Your Choices" --yesno "$(printf "%s" "$confirm_message")" 25 80; then + echo -e "\n" + echo "❌ ${SKY_BLUE}You 🫵 cancelled the confirmation${RESET}. ${YELLOW}Exiting...${RESET}" + exit 0 + fi + + echo "👌 ${OK} You confirmed your choices. Proceeding with ${SKY_BLUE}KooL 🇵🇭 Hyprland Installation...${RESET}" + break +done + +# Proceed with installation +echo "${OK} - Proceeding with selected options..." + +echo "Adding some COPR repos..." sleep 1 -# Install hyprland packages execute_script "copr.sh" -execute_script "00-hypr-pkgs.sh" + +echo "Installing KooL Hyprland additional packages..." +sleep 1 +execute_script "01-hypr-pkgs.sh" + +echo "Installing necessary fonts..." +sleep 1 execute_script "fonts.sh" + +echo "Installing Hyprland..." +sleep 1 execute_script "hyprland.sh" -if [ "$nvidia" == "Y" ]; then - execute_script "nvidia.sh" -fi +# Clean up the selected options (remove quotes and trim spaces) +selected_options=$(echo "$selected_options" | tr -d '"' | tr -s ' ') -if [ "$gtk_themes" == "Y" ]; then - execute_script "gtk_themes.sh" -fi +# Convert selected options into an array (splitting by spaces) +IFS=' ' read -r -a options <<< "$selected_options" -if [ "$bluetooth" == "Y" ]; then - execute_script "bluetooth.sh" -fi - -if [ "$thunar" == "Y" ]; then - execute_script "thunar.sh" -fi -if [ "$thunar_choice" == "Y" ]; then - execute_script "thunar_default.sh" -fi - -if [ "$ags" == "Y" ]; then - execute_script "ags.sh" -fi - -if [ "$sddm" == "Y" ]; then - execute_script "sddm.sh" -fi -if [ "$sddm_theme" == "Y" ]; then - execute_script "sddm_theme.sh" -fi - -if [ "$xdph" == "Y" ]; then - execute_script "xdph.sh" -fi - -if [ "$zsh" == "Y" ]; then - execute_script "zsh.sh" -fi -if [ "$pokemon_choice" == "Y" ]; then - execute_script "zsh_pokemon.sh" -fi - -if [ "$input_group" == "Y" ]; then - execute_script "InputGroup.sh" -fi - -if [ "$rog" == "Y" ]; then - execute_script "rog.sh" -fi - -if [ "$dots" == "Y" ]; then - execute_script "dotfiles-main.sh" -fi +# Loop through selected options +for option in "${options[@]}"; do + case "$option" in + sddm) + if check_services_running; then + # If any log in managers are active + whiptail --title "Error" --msgbox "One of the following login services is running:\n$(IFS=$'\n'; echo "${services[*]}")\n\nPlease stop it or DO not choose SDDM." 12 60 + exec "$0" + else + echo "Installing and configuring SDDM..." + execute_script "sddm.sh" + fi + ;; + nvidia) + echo "Configuring nvidia stuff" + execute_script "nvidia.sh" + ;; + gtk_themes) + echo "Installing GTK themes..." + execute_script "gtk_themes.sh" + ;; + input_group) + echo "Adding user into input group..." + execute_script "InputGroup.sh" + ;; + ags) + echo "Installing AGS..." + execute_script "ags.sh" + ;; + xdph) + echo "Installing XDG-DESKTOP-PORTAL-HYPRLAND..." + execute_script "xdph.sh" + ;; + bluetooth) + echo "Configuring Bluetooth..." + execute_script "bluetooth.sh" + ;; + thunar) + echo "Installing Thunar file manager..." + execute_script "thunar.sh" + execute_script "thunar_default.sh" + ;; + sddm_theme) + echo "Downloading & Installing Additional SDDM theme..." + execute_script "sddm_theme.sh" + ;; + zsh) + echo "Installing zsh with Oh-My-Zsh..." + execute_script "zsh.sh" + ;; + pokemon) + echo "Adding Pokemon color scripts to terminal..." + execute_script "zsh_pokemon.sh" + ;; + rog) + echo "Installing ROG packages..." + execute_script "rog.sh" + ;; + dots) + echo "Installing pre-configured Hyprland dotfiles..." + execute_script "dotfiles-main.sh" + ;; + *) + echo "Unknown option: $option" + ;; + esac +done clear @@ -297,12 +347,12 @@ printf "\n%.0s" {1..1} # Check if hyprland or hyprland-git is installed if rpm -q hyprland &> /dev/null || rpm -q hyprland-git &> /dev/null; then - printf "\n${OK} Hyprland is installed. However, some essential packages may not be installed. Please see above!" + printf "\n ${OK} 👌 Hyprland is installed. However, some essential packages may not be installed. Please see above!" printf "\n${CAT} Ignore this message if it states ${YELLOW}All essential packages${RESET} are installed as per above\n" sleep 2 printf "\n%.0s" {1..2} - printf "${SKY_BLUE}Thank you${RESET} for using ${MAGENTA}KooL's Hyprland Dots${RESET}. ${YELLOW}Enjoy and Have a good day!${RESET}" + printf "${SKY_BLUE}Thank you${RESET} 🫰 for using 🇵🇭 ${MAGENTA}KooL's Hyprland Dots${RESET}. ${YELLOW}Enjoy and Have a good day!${RESET}" printf "\n%.0s" {1..2} printf "\n${NOTE} You can start Hyprland by typing ${SKY_BLUE}Hyprland${RESET} (IF SDDM is not installed) (note the capital H!).\n" @@ -316,7 +366,7 @@ if rpm -q hyprland &> /dev/null || rpm -q hyprland-git &> /dev/null; then echo "${INFO} Rebooting now..." systemctl reboot elif [[ "$HYP" == "n" || "$HYP" == "no" ]]; then - echo "${OK} You choose NOT to reboot" + echo "👌 ${OK} You choose NOT to reboot" printf "\n%.0s" {1..1} # Check if NVIDIA GPU is present if lspci | grep -i "nvidia" &> /dev/null; then diff --git a/preset.sh b/preset.sh index 6cc5932..cc6f032 100644 --- a/preset.sh +++ b/preset.sh @@ -1,50 +1,48 @@ # 💫 https://github.com/JaKooLit 💫 # -# CREDIT to: https://github.com/PostCyberPunk for this Preset function - -## -- Make sure you use the right answer or install script will fail ### -# The rest Change to Y for Yes and N for No. +# Define the options you want to preselect (either ON or OFF) +# IMPORTANT: answer should be inside "" +### Script will install nvidia-dkms nvidia-utils & nvidia-settings ###-Would you like script to Configure NVIDIA for you? -nvidia="N" +nvidia="OFF" +### Would you like to blacklist nouveau? (y/n) +nouveau="OFF" ###-Install GTK themes (required for Dark/Light function)? -gtk_themes="Y" +gtk_themes="ON" ###-Do you want to configure Bluetooth? -bluetooth="Y" +bluetooth="ON" ###-Do you want to install Thunar file manager? -thunar="Y" -### Do you want to set Thunar as the default file manager? -thunar_choice="Y" - +thunar="ON" ### Adding user to the 'input' group might be necessary for waybar keyboard-state functionality -input_group="Y" +input_group="ON" +### Desktop overview Demo Link in README ### Desktop overview Demo Link in README ### Install AGS (aylur's GTK shell) v1 for Desktop-Like Overview?" -ags="Y" +ags="ON" ###-Install & configure SDDM log-in Manager -sddm="Y" +sddm="ON" ### install and download SDDM themes -sddm_theme="Y" +sddm_theme="ON" ###-Install XDG-DESKTOP-PORTAL-HYPRLAND? (For proper Screen Share ie OBS) -xdph="Y" +xdph="ON" ### Shell extension. Bash alternative ###-Install zsh, oh-my-zsh -zsh="Y" - -### add Pokemon color scripts to terminal -pokemon_choice="Y" +zsh="ON" +### add Pokemon color scripts to terminal +pokemon="ON" ### This will install ASUSCTL & SUPERGFXCTL ###-Installing on Asus ROG Laptops? -rog="N" +rog="OFF" -###-Do you want to add pre-configured KooL's Hyprland dotfiles? -dots="Y" +###-Download and Add pre-configured Hyprland dotfiles? +dots="ON"