diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 523d04d..048a937 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,5 +1,9 @@ ## Changelogs +## 30 December 2023 +- Code Cleaned up. +- Pokemon Color Scripts now offered as optional + ## 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/Debian-Installer.png b/Debian-Installer.png index d445f8d..d5c4cb3 100644 Binary files a/Debian-Installer.png and b/Debian-Installer.png differ diff --git a/README.md b/README.md index d4b79ef..1d49210 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,17 @@ sudo nano /etc/apt/sources.list - ensure to allow to install non-free drivers especially for users with NVIDIA gpus. You can also install non-free drivers if required. Edit install-scripts/nvidia.sh and change the nvidia stuff's if required - If you have login Manager already like GDM (gnome login manager), I highly advice not to install SDDM. But if you decide to install SDDM, see here [`Issue 2 - SDDM`](https://github.com/JaKooLit/Debian-Hyprland/issues/2) -#### 🔔 NOTICE TO UBUNTU USERS ### -- You can use this installer. However, I have only tested on Ubuntu 23.10. Not sure if it works on older ubuntu as Hyprland needs an updated wayland libraries. For sure wont work in any Ubuntu LTS. -- If you are using Gnome already, DO NOT install the SDDM. The GDM works file as well. For some reason, during installation, you will be asked which login manager you wanted to use. But during my test, nothing happened. -- For Ubuntu with NVIDIA GPU's, make sure to edit the install-scripts/nvidia.sh . Delete all packages in nvidia_pkg except libva-wayland2 and nvidia-vaapi-driver and uncomment/remove # before sudo ubuntu-drivers install. You also need to delete or simply just add # in the lines 44 and 45 echo "echo "## for nvidia" | sudo tee -a... and echo "deb http://deb.debian.org/debian........ +> [!IMPORTANT] +> UBUNTU USERS: You can use this installer. However, I have only tested on Ubuntu 23.10. Not sure if it works on older ubuntu as Hyprland needs an updated wayland libraries. For sure wont work in any Ubuntu LTS. +> If you are using Gnome already, DO NOT install the SDDM. The GDM works file as well. For some reason, during installation, you will be asked which login manager you wanted to use. But during my test, nothing happened. -#### ⚠️ WARNING! If you have GDM already as log-in manager, DO NOT install SDDM -- You will encounter issues. See [`Issue 2 - SDDM`](https://github.com/JaKooLit/Debian-Hyprland/issues/2) +> [!CAUTION] +> For Ubuntu with NVIDIA GPU's, make sure to edit the install-scripts/nvidia.sh . Delete all packages in nvidia_pkg except libva-wayland2 and nvidia-vaapi-driver and uncomment/remove # before sudo ubuntu-drivers install. You also need to delete or simply just add # in the lines 37 and 38 echo "echo "## for nvidia" | sudo tee -a... and echo "deb http://deb.debian.org/debian........ + + +> [!WARNING] +> If you have GDM already as log-in manager, DO NOT install SDDM +> You will encounter issues. See [`Issue 2 - SDDM`](https://github.com/JaKooLit/Debian-Hyprland/issues/2) #### 📷 Hyprland-Dots-v2 Featuring Rofi
@@ -135,39 +139,8 @@ source ~/.zshrc - swappy [`LINK`](https://github.com/jtheoof/swappy) - xdg-desktop-portal-hyprland [`LINK`](https://github.com/hyprwm/xdg-desktop-portal-hyprland) - rofi-wayland [`LINK`](https://github.com/lbonn/rofi) - -- a.) to update these package, in your installation folder, you can move these folders, `Hyprland` `nwg-look` `swaylock-effects` `swappy` `swww` `rofi` `asusctl` `supergfxctl`, as appropriate or download manually, cd into it, update/install - -~~- b.) to update Hyprland and xdg-desktop-portal-hyprland~~ -~~``` bash~~ -~~git pull~~ -~~make all~~ -~~sudo make install~~ -~~```~~ -- c.) for nwg-look, asusctl, supergfxtctl, to update ran -``` bash -git pull -sudo make install -``` -- c.) for swww, to update -``` bash -git pull -cargo build --release -``` -- d.) for swaylock-effects and swappy -``` bash -git pull -meson build -ninja -C build -sudo ninja -C build install -``` -- e.) for rofi-wayland -``` bash -git pull -meson setup build -ninja -C build -sudo ninja -C build install -``` +> [!TIP] +> To update to latest packages, re-running this script will auto update all. Script is configured to pull latest packages build for you. #### 🤬 FAQ #### Most common question I got is, Hey Ja, Why the heck it is taking long time to install? Other distro like Arch its only a minute or two. Why here takes like forever?!?!?! @@ -184,6 +157,10 @@ sudo ninja -C build install - for the install part, kindly open issue on this repo - for the Pre-configured Hyprland dots / configuration, submit issue [`here`](https://github.com/JaKooLit/Hyprland-Dots/issues) +#### 🔧 Proper way to re-installing a particular script from install-scripts folder +- CD into Fedora-Hyprland Folder and then ran the below command. +- i.e. `./install-scripts/gtk-themes` - For reinstall GTK Themes. + #### 🛣️ Roadmap: - ~~[ ] Install zsh and oh-my-zsh without necessary steps above~~ DONE - [ ] possibly adding gruvbox themes, cursors, icons diff --git a/assets/.zshrc b/assets/.zshrc index 170ec8e..2c03e68 100644 --- a/assets/.zshrc +++ b/assets/.zshrc @@ -16,7 +16,7 @@ source $ZSH/oh-my-zsh.sh # Display Pokemon-colorscripts # Project page: https://gitlab.com/phoneybadger/pokemon-colorscripts#on-other-distros-and-macos -pokemon-colorscripts --no-title -s -r +#pokemon-colorscripts --no-title -s -r ### From this line is for pywal-colors diff --git a/install-scripts/00-dependencies.sh b/install-scripts/00-dependencies.sh old mode 100644 new mode 100755 index 0a62875..3b8987b --- a/install-scripts/00-dependencies.sh +++ b/install-scripts/00-dependencies.sh @@ -1,8 +1,6 @@ #!/bin/bash - -# https://github.com/JaKooLit - -# WARNING! If you remove packages here, Hyprland may not work properly. +# 💫 https://github.com/JaKooLit 💫 # +# main dependencies # # packages neeeded dependencies=( @@ -97,7 +95,7 @@ dependencies=( xwayland ) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -105,41 +103,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_dependencies.log" - -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} - +LOG="Install-Logs/install-$(date +%d-%H%M%S)_dependencies.log" # Installation of main dependencies printf "\n%s - Installing main dependencies.... \n" "${NOTE}" diff --git a/install-scripts/00-hypr-pkgs.sh b/install-scripts/00-hypr-pkgs.sh old mode 100644 new mode 100755 index da9e22d..0519ba9 --- a/install-scripts/00-hypr-pkgs.sh +++ b/install-scripts/00-hypr-pkgs.sh @@ -1,10 +1,9 @@ #!/bin/bash - -# https://github.com/JaKooLit - +# 💫 https://github.com/JaKooLit 💫 # +# Hyprland-Dots Packages # # edit your packages desired here. # WARNING! If you remove packages here, dotfiles may not work properly. -# and also, ensure that packages are present in debian repo +# and also, ensure that packages are present in Debian Official Repo # add packages wanted here Extra=( @@ -63,7 +62,7 @@ uninstall=( mako ) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -71,58 +70,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_hypr-pkgs.log" - -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 sudo dpkg -l | grep -q -w "$1" ; then - # Package is installed - echo -e "${NOTE} Uninstalling $1 ..." - sudo apt-get autoremove -y "$1" 2>&1 | tee -a "$LOG" - # Making sure package is uninstalled - if ! sudo dpkg -l | grep -q -w "$1" ; 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 uninstall.log." - exit 1 - fi - fi -} +LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypr-pkgs.log" # 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 new file mode 100755 index 0000000..287feb9 --- /dev/null +++ b/install-scripts/Global_functions.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Global Functions for Scripts # + +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + +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) + + +# Function for installing packages +install_package() { + # Checking if package is already installed + if sudo dpkg -l | grep -q -w "$1" ; then + echo -e "${OK} $1 is already installed. Skipping..." + else + # Package not installed + echo -e "${NOTE} Installing $1 ..." + sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" + # Making sure the package is installed + if sudo dpkg -l | grep -q -w "$1" ; then + echo -e "\e[1A\e[K${OK} $1 was installed." + else + # Something is missing, exiting to review the 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 +} + +uninstall_package() { + # Check if package is installed + if sudo dpkg -l | grep -q -w "^ii $1" ; then + # Package is installed, attempt to uninstall + echo -e "${NOTE} Uninstalling $1 ..." + + # Attempt to uninstall the package and its configuration files + sudo apt-get autoremove -y "$1" >> "$LOG" 2>&1 + + # Check if the package is still installed after removal attempt + if ! dpkg -l | grep -q -w "^ii $1" ; then + echo -e "\e[1A\e[K${OK} $1 was uninstalled." + else + echo -e "\e[1A\e[K${ERROR} $1 failed to uninstall. Please check the uninstall.log." + exit 1 + fi + fi +} diff --git a/install-scripts/InputGroup.sh b/install-scripts/InputGroup.sh old mode 100644 new mode 100755 index e82e37b..0633997 --- a/install-scripts/InputGroup.sh +++ b/install-scripts/InputGroup.sh @@ -1,6 +1,8 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Adding user in input group for waybar keyboard state module # -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -8,18 +10,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_input.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_input.log" while true; do echo "${WARN} This script will add or remove your user from the 'input' group." @@ -30,26 +24,29 @@ while true; do if [[ $choice == "y" || $choice == "Y" ]]; then # Check if the 'input' group exists if grep -q '^input:' /etc/group; then - echo "${OK} 'input' group exists." + echo "${OK} 'input' group exists." 2>&1 | tee -a "$LOG" else - echo "${NOTE} 'input' group doesn't exist. Creating 'input' group..." + echo "${NOTE} 'input' group doesn't exist. Creating 'input' group..." 2>&1 | tee -a "$LOG" sudo groupadd input # Log the creation of the 'input' group - echo "$(date '+%Y-%m-%d %H:%M:%S') - 'input' group created" >> "$LOG" + echo "${NOTE} 'input' group created" 2>&1 | tee -a "$LOG" fi # Add the user to the input group sudo usermod -aG input "$(whoami)" - echo "${OK} User added to the 'input' group. Changes will take effect after you log out and log back in." + echo "${OK} User added to the 'input' group. Changes will take effect after you log out and log back in." 2>&1 | tee -a "$LOG" # Log the addition of the user to the 'input' group - echo "$(date '+%Y-%m-%d %H:%M:%S') - User added to 'input' group" >> "$LOG" + echo "${NOTE} - User added to 'input' group" 2>&1 | tee -a "$LOG" break # Break out of the loop if 'yes' is chosen + elif [[ $choice == "n" || $choice == "N" ]]; then - echo "${NOTE} No changes made. Exiting the script." + echo "${NOTE} No changes made. Exiting the script." 2>&1 | tee -a "$LOG" break # Break out of the loop if 'no' is chosen else echo "${ERROR} Invalid choice. Please enter 'y' for yes or 'n' for no." fi done + +clear \ No newline at end of file diff --git a/install-scripts/bluetooth.sh b/install-scripts/bluetooth.sh old mode 100644 new mode 100755 index 9aa68cd..4ad49f8 --- a/install-scripts/bluetooth.sh +++ b/install-scripts/bluetooth.sh @@ -1,12 +1,13 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Bluetooth # blue=( bluez blueman ) - -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -14,51 +15,19 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_bluetooth.log" - -# Set the script to exit on error -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} +LOG="Install-Logs/install-$(date +%d-%H%M%S)_bluetooth.log" # Bluetooth - printf "${NOTE} Installing Bluetooth Packages...\n" for BLUE in "${blue[@]}"; do install_package "$BLUE" 2>&1 | tee -a "$LOG" [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $BLUE install had failed, please check the install.log"; exit 1; } done - printf " Activating Bluetooth Services...\n" - sudo systemctl enable --now bluetooth.service 2>&1 | tee -a "$LOG" +printf " Activating Bluetooth Services...\n" +sudo systemctl enable --now bluetooth.service 2>&1 | tee -a "$LOG" - clear +clear diff --git a/install-scripts/dotfiles.sh b/install-scripts/dotfiles.sh old mode 100644 new mode 100755 index 06e5716..c1fd618 --- a/install-scripts/dotfiles.sh +++ b/install-scripts/dotfiles.sh @@ -1,14 +1,10 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Hyprland-Dots to download from Releases # -# 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) +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## + +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" printf "${NOTE} Downloading / Checking for existing Hyprland-Dots.tar.gz...\n" @@ -34,27 +30,29 @@ if [ -f Hyprland-Dots.tar.gz ]; then echo -e "${WARN} Hyprland-Dots.tar.gz is outdated (Existing version: $existing_version, Latest version: $latest_version)." read -p "Do you want to upgrade to the latest version? (y/n): " upgrade_choice if [ "$upgrade_choice" = "y" ]; then - echo -e "${NOTE} Proceeding to download the latest release." + echo -e "${NOTE} Proceeding to download the latest release." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" # Delete existing directories starting with JaKooLit-Hyprland-Dots find . -type d -name 'JaKooLit-Hyprland-Dots*' -exec rm -rf {} + rm -f Hyprland-Dots.tar.gz printf "${WARN} Removed existing Hyprland-Dots.tar.gz.\n" else - echo -e "${NOTE} User chose not to upgrade. Exiting..." + echo -e "${NOTE} User chose not to upgrade. Exiting..." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" exit 0 fi fi fi -printf "${NOTE} Downloading the latest Hyprland source code release...\n" +printf "\n" + +printf "${NOTE} Downloading the latest Hyprland-Dots source code release...\n" # Fetch the tag name for the latest release using the GitHub API latest_tag=$(curl -s https://api.github.com/repos/JaKooLit/Hyprland-Dots/releases/latest | grep "tag_name" | cut -d '"' -f 4) # Check if the tag is obtained successfully if [ -z "$latest_tag" ]; then - echo -e "${ERROR} Unable to fetch the latest tag information." + echo -e "${ERROR} Unable to fetch the latest tag information." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" exit 1 fi @@ -63,7 +61,7 @@ latest_tarball_url=$(curl -s https://api.github.com/repos/JaKooLit/Hyprland-Dots # Check if the URL is obtained successfully if [ -z "$latest_tarball_url" ]; then - echo -e "${ERROR} Unable to fetch the tarball URL for the latest release." + echo -e "${ERROR} Unable to fetch the tarball URL for the latest release." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" exit 1 fi @@ -88,10 +86,12 @@ if curl -L "$latest_tarball_url" -o "$file_name"; then # Set execute permission for copy.sh and execute it chmod +x copy.sh - ./copy.sh 2>&1 | tee -a "../install-$(date +'%d-%H%M%S')_dots.log" + ./copy.sh - echo -e "${OK} Latest source code release downloaded, extracted, and processed successfully." + echo -e "${OK} Latest Dotfiles release downloaded, extracted, and processed successfully. Check JaKooLit-Hyprland-Dots folder for more detailed install logs" 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" else - echo -e "${ERROR} Failed to download the latest source code release." + echo -e "${ERROR} Failed to download the latest Dotfiles release." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" exit 1 fi + +clear \ No newline at end of file diff --git a/install-scripts/fonts.sh b/install-scripts/fonts.sh old mode 100644 new mode 100755 index 77efce1..c657e11 --- a/install-scripts/fonts.sh +++ b/install-scripts/fonts.sh @@ -1,4 +1,6 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Fonts Required # fonts=( fonts-firacode @@ -8,8 +10,7 @@ fonts-noto-cjk fonts-noto-color-emoji ) - -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -17,41 +18,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 - -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_fonts.log" - -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} +LOG="Install-Logs/install-$(date +%d-%H%M%S)_fonts.log" # Installation of main components printf "\n%s - Installing fonts.... \n" "${NOTE}" @@ -65,6 +35,7 @@ for PKG1 in "${fonts[@]}"; do done # jetbrains nerd font. Necessary for waybar +printf "\n%s - Downloading and Extracting Jetbrains Mono Nerd Font.... \n" "${NOTE}" DOWNLOAD_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz" # Maximum number of download attempts MAX_ATTEMPTS=3 diff --git a/install-scripts/force-install.sh b/install-scripts/force-install.sh old mode 100644 new mode 100755 index 77cd9ed..c715766 --- a/install-scripts/force-install.sh +++ b/install-scripts/force-install.sh @@ -1,37 +1,29 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# force reinstall packages cause it says its already installed but still not +# some users report that they need to install this packages force=( imagemagick ) -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_force.log" - +LOG="Install-Logs/install-$(date +%d-%H%M%S)_force.log" printf "${NOTE} Force installing packages...\n" for FORCE in "${force[@]}"; do sudo apt-get --reinstall install -y "$FORCE" 2>&1 | tee -a "$LOG" - [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $CLIP install had failed, please check the install.log"; exit 1; } + [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $FORCE install had failed, please check the install.log"; exit 1; } done - clear \ No newline at end of file diff --git a/install-scripts/gtk_themes.sh b/install-scripts/gtk_themes.sh old mode 100644 new mode 100755 index ad156e7..3f06374 --- a/install-scripts/gtk_themes.sh +++ b/install-scripts/gtk_themes.sh @@ -1,11 +1,13 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# GTK Themes & ICONS and Sourcing from a different Repo # engine=( unzip gtk2-engines-murrine ) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -13,40 +15,11 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_themes.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_themes.log" -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 @@ -64,10 +37,10 @@ if [ -d "GTK-themes-icons" ]; then fi echo "$NOTE Cloning Tokyo Theme GTK themes and Icons repository..." 2>&1 | tee -a "$LOG" -if git clone https://github.com/JaKooLit/GTK-themes-icons.git 2>&1 | tee -a "$LOG"; then +if git clone https://github.com/JaKooLit/GTK-themes-icons.git ; then cd GTK-themes-icons chmod +x auto-extract.sh - ./auto-extract.sh 2>&1 | tee -a "$LOG" + ./auto-extract.sh cd .. echo "$OK Extracted GTK Themes & Icons to ~/.icons & ~/.themes folders" 2>&1 | tee -a "$LOG" else @@ -77,4 +50,4 @@ fi tar -xf "assets/Bibata-Modern-Ice.tar.xz" -C ~/.icons 2>&1 | tee -a "$LOG" echo "$OK Extracted Bibata-Modern-Ice.tar.xz to ~/.icons folder." 2>&1 | tee -a "$LOG" -clear +clear \ No newline at end of file diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh old mode 100644 new mode 100755 index 3012af7..65274a4 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -1,17 +1,20 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Main Hyprland Package# -# 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) +## 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 + +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_hyprland.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland.log" +MLOG="install-$(date +%d-%H%M%S)_hyprland2.log" # Clone, build, and install Hyprland using Cmake printf "${NOTE} Cloning Hyprland...\n" @@ -22,17 +25,18 @@ if [ -d "Hyprland" ]; then rm -rf "Hyprland" 2>&1 | tee -a "$LOG" fi -if git clone --recursive -b v0.32.3 "https://github.com/hyprwm/Hyprland" 2>&1 | tee -a "$LOG"; then +if git clone --recursive -b v0.32.3 "https://github.com/hyprwm/Hyprland"; then cd "Hyprland" || exit 1 - make all 2>&1 | tee -a "$LOG" - if sudo make install 2>&1 | tee -a "$LOG"; then - printf "${OK} Hyprland installed successfully.\n" + make all + if sudo make install 2>&1 | tee -a "$MLOG"; then + printf "${OK} Hyprland installed successfully.\n" 2>&1 | tee -a "$MLOG" else - echo -e "${ERROR} Installation failed for Hyprland." - fi + echo -e "${ERROR} Installation failed for Hyprland." 2>&1 | tee -a "$MLOG" + fi + mv $MLOG ../Install-Logs/ || true cd .. else - echo -e "${ERROR} Download failed for Hyprland." + echo -e "${ERROR} Download failed for Hyprland." 2>&1 | tee -a "$LOG" fi clear diff --git a/install-scripts/nvidia.sh b/install-scripts/nvidia.sh old mode 100644 new mode 100755 index 689497b..b40edc7 --- a/install-scripts/nvidia.sh +++ b/install-scripts/nvidia.sh @@ -1,4 +1,7 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Nvidia - Check Readme for more details for the drivers # +# UBUNTU USERS, FOLLOW README! nvidia_pkg=( nvidia-driver @@ -12,7 +15,7 @@ nvidia_pkg=( # for ubuntu-nvidia owners! just delete # # sudo ubuntu-drivers install -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -20,20 +23,11 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_nvidia.log" - -set -e +LOG="Install-Logs/install-$(date +%d-%H%M%S)_nvidia.log" +MLOG="install-$(date +%d-%H%M%S)_nvidia2.log" ## adding the deb source for nvidia driver # Create a backup of the sources.list file @@ -47,26 +41,6 @@ echo "deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-fi # Update the package list sudo apt update -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 to add a value to a configuration file if not present add_to_file() { local config_file="$1" @@ -80,8 +54,8 @@ add_to_file() { fi } -# Clone, build, and install nvidia-Hyprland using Cmake -printf "${NOTE} Installing nvidia-Hyprland...\n" +# Clone, build, and install Hyprland using Cmake +printf "${NOTE} Cloning Hyprland...\n" # Check if Hyprland folder exists and remove it if [ -d "Hyprland" ]; then @@ -89,20 +63,21 @@ if [ -d "Hyprland" ]; then rm -rf "Hyprland" 2>&1 | tee -a "$LOG" fi -if git clone --recursive -b v0.32.3 "https://github.com/hyprwm/Hyprland" 2>&1 | tee -a "$LOG"; then - cd Hyprland || exit 1 +if git clone --recursive -b v0.32.3 "https://github.com/hyprwm/Hyprland"; then + cd "Hyprland" || exit 1 make all - if sudo make install 2>&1 | tee -a "$LOG"; then - printf "${OK} Nvidia-Hyprland installed successfully.\n" - # Return to the previous directory - cd .. + if sudo make install 2>&1 | tee -a "$MLOG"; then + printf "${OK} Hyprland installed successfully.\n" 2>&1 | tee -a "$MLOG" else - echo -e "${ERROR} Installation failed for Nvidia-Hyprland." 2>&1 | tee -a "$LOG" + echo -e "${ERROR} Installation failed for Hyprland." 2>&1 | tee -a "$MLOG" fi + mv $MLOG ../Install-Logs/ || true + cd .. else - echo -e "${ERROR} Download failed for Nvidia-Hyprland." 2>&1 | tee -a "$LOG" + echo -e "${ERROR} Download failed for Hyprland." 2>&1 | tee -a "$LOG" fi + # Install additional Nvidia packages printf "${YELLOW} Installing Nvidia packages...\n" for NVIDIA in "${nvidia_pkg[@]}"; do diff --git a/install-scripts/nwg-look.sh b/install-scripts/nwg-look.sh old mode 100644 new mode 100755 index 6b3635f..c8883fe --- a/install-scripts/nwg-look.sh +++ b/install-scripts/nwg-look.sh @@ -1,4 +1,6 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# nwg-look ) # nwg_look=( golang @@ -7,68 +9,57 @@ nwg_look=( libglib2.0-bin ) -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_nwg-look.log" +LOG="Install-Logs/install-$(date +'%d-%H%M%S')_nwg-look.log" +MLOG="install-$(date +'%d-%H%M%S')_nwg-look2.log" -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 +# Installing NWG-Look Dependencies +for PKG1 in "${nwg_look[@]}"; do + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\033[1A\033[K${ERROR} - $PKG1 install had failed, please check the install.log" + exit 1 fi -} - -for package in "${nwg_look[@]}"; do - install_package "$package" || exit 1 done - -# Check if nwg-look folder exists and remove it -if [ -d "nwg-look" ]; then - printf "${NOTE} Removing existing nwg-look folder...\n" - rm -rf "nwg-look" 2>&1 | tee -a "$LOG" -fi - printf "${NOTE} Installing nwg-look\n" -if git clone https://github.com/nwg-piotr/nwg-look.git; then +# Check if nwg-look directory exists +if [ -d "nwg-look" ]; then + printf "${INFO} nwg-look directory already exists. Updating...\n" cd nwg-look || exit 1 - make build - sudo make install - cd .. + git stash + git pull else - echo -e "${ERROR} Download failed for nwg-look." - exit 1 + # Clone nwg-look repository if directory doesn't exist + if git clone https://github.com/nwg-piotr/nwg-look.git; then + cd nwg-look || exit 1 + else + echo -e "${ERROR} Download failed for nwg-look." 2>&1 | tee -a "$LOG" + mv "$MLOG" ../Install-Logs/ || true + exit 1 + fi fi +# Build nwg-look +make build +if sudo make install 2>&1 | tee -a "$MLOG"; then + printf "${OK} nwg-look installed successfully.\n" 2>&1 | tee -a "$MLOG" +else + echo -e "${ERROR} Installation failed for nwg-look" 2>&1 | tee -a "$MLOG" +fi + +# Move logs to Install-Logs directory +mv "$MLOG" ../Install-Logs/ || true +cd .. + clear diff --git a/install-scripts/pywal.sh b/install-scripts/pywal.sh old mode 100644 new mode 100755 index e82822d..0fa5516 --- a/install-scripts/pywal.sh +++ b/install-scripts/pywal.sh @@ -1,59 +1,32 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Pywal Colors) # pywal=( imagemagick python3-pip ) -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_pywal.log" - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} +LOG="Install-Logs/install-$(date +'%d-%H%M%S')_pywal.log" +# Installing Pywal dependencies for package in "${pywal[@]}"; do install_package "$package" || exit 1 done ## Installing pywal colors printf "\n%s - Installing Pywal.... \n" "${NOTE}" - sudo pip3 install pywal --break-system-packages 2>&1 | tee -a "$LOG" clear diff --git a/install-scripts/rofi-wayland.sh b/install-scripts/rofi-wayland.sh old mode 100644 new mode 100755 index c42e998..053a58a --- a/install-scripts/rofi-wayland.sh +++ b/install-scripts/rofi-wayland.sh @@ -1,11 +1,13 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Rofi-Wayland) # rofi=( bison flex ) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -13,87 +15,68 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_rofi_wayland.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_rofi_wayland.log" +MLOG="install-$(date +%d-%H%M%S)_rofi_wayland2.log" # uninstall other rofi -printf "${YELLOW} Checking for other rofi packages and remove if any..${RESET}\n" -if sudo dpkg -l | grep -q -w "rofi"; then - printf "${YELLOW} rofi detected.. uninstalling...${RESET}\n" - for rofi in rofi; do - sudo apt-get autoremove -y "rofi" 2>/dev/null | tee -a "$LOG" || true - done -fi - -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} - -# Installation of main components -printf "\n%s - Installing rofi-wayland dependencies.... \n" "${NOTE}" - -for PKG1 in "${rofi[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" +for PKG in "rofi" "bison"; do + uninstall_package "$PKG" 2>&1 | tee -a "$LOG" if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 install had failed, please check the install.log" + echo -e "\e[1A\e[K${ERROR} - $PKG uninstallation had failed, please check the log" exit 1 fi done -printf "\n\n\n" +sleep 1 +printf "\n" +# Installation of main components +printf "\n%s - Installing rofi-wayland dependencies.... \n" "${NOTE}" + +printf "${NOTE} Force installing packages...\n" + for FORCE in "${rofi[@]}"; do + sudo apt-get --reinstall install -y "$FORCE" 2>&1 | tee -a "$LOG" + [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $FORCE install had failed, please check the install.log"; exit 1; } + done + +printf "\n\n" # Clone and build rofi - wayland printf "${NOTE} Installing rofi-wayland...\n" -# Check if rofi folder exists and remove it +printf "${NOTE} Installing rofi-wayland\n" + +# Check if rofi folder exists if [ -d "rofi" ]; then - printf "${NOTE} Removing existing rofi folder...\n" - rm -rf "rofi" 2>&1 | tee -a "$LOG" + printf "${NOTE} rofi folder exists. Pulling latest changes...\n" + cd rofi || exit 1 + git pull origin master 2>&1 | tee -a "$MLOG" +else + printf "${NOTE} Cloning rofi repository...\n" + if git clone https://github.com/lbonn/rofi.git; then + cd rofi || exit 1 + else + echo -e "${ERROR} Download failed for rofi-wayland." 2>&1 | tee -a "$LOG" + exit 1 + fi fi -if git clone https://github.com/lbonn/rofi.git 2>&1 | tee -a "$LOG"; then - cd "rofi" || exit 1 - if meson setup build && ninja -C build; then - if sudo ninja -C build install 2>&1 | tee -a "$LOG"; then - printf "${OK} rofi-wayland installed successfully.\n" - # Return to the previous directory - cd .. - else - echo -e "${ERROR} Installation failed for rofi-wayland." - fi +# Proceed with the installation steps +if meson setup build && ninja -C build; then + if sudo ninja -C build install 2>&1 | tee -a "$MLOG"; then + printf "${OK} rofi-wayland installed successfully.\n" 2>&1 | tee -a "$MLOG" else - echo -e "${ERROR} Meson setup or ninja build failed for rofi-wayland." + echo -e "${ERROR} Installation failed for rofi-wayland." 2>&1 | tee -a "$MLOG" fi else - echo -e "${ERROR} Download failed for rofi-wayland." + echo -e "${ERROR} Meson setup or ninja build failed for rofi-wayland." 2>&1 | tee -a "$MLOG" fi -clear \ No newline at end of file +# Move logs to Install-Logs directory +mv "$MLOG" ../Install-Logs/ || true +cd .. || exit 1 + +clear + diff --git a/install-scripts/rog.sh b/install-scripts/rog.sh old mode 100644 new mode 100755 index 3931290..8860cd4 --- a/install-scripts/rog.sh +++ b/install-scripts/rog.sh @@ -1,26 +1,19 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# ASUS ROG ) # -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_rog.log" +LOG="install-$(date +%d-%H%M%S)_rog.log" # Function to handle the installation and log messages install_and_log() { @@ -45,7 +38,8 @@ install_and_log() { echo -e "${ERROR} Installation failed for $project_name." fi - # Return to the previous directory + #moving logs into main install-logs + mv $LOG ../Install-Logs/ || true cd - || exit 1 else echo -e "${ERROR} Cloning $project_name from $git_url failed." @@ -58,5 +52,4 @@ install_and_log "asusctl" "https://gitlab.com/asus-linux/asusctl.git" # Download and build supergfxctl install_and_log "supergfxctl" "https://gitlab.com/asus-linux/supergfxctl.git" - -clear +clear \ No newline at end of file diff --git a/install-scripts/sddm.sh b/install-scripts/sddm.sh old mode 100644 new mode 100755 index 1d8ddf9..8a3181e --- a/install-scripts/sddm.sh +++ b/install-scripts/sddm.sh @@ -1,9 +1,8 @@ #!/bin/bash -# https://github.com/JaKooLit - -# WARNING! If you remove packages here, dotfiles may not work properly. -# and also, ensure that packages are present in debian repo +# 💫 https://github.com/JaKooLit 💫 # +# SDDM with optional SDDM theme # +# installing with NO-recommends sddm1=( sddm ) @@ -16,6 +15,7 @@ sddm2=( qml-module-qtquick-layouts ) +## 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 )" @@ -23,42 +23,13 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_sddm.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm.log" -set -e -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 SDDM and Tokyo-Night theme +# Install SDDM (no-recommends) printf "\n%s - Installing sddm.... \n" "${NOTE}" for PKG1 in "${sddm1[@]}" ; do sudo apt-get install --no-install-recommends -y "$PKG1" 2>&1 | tee -a "$LOG" @@ -117,7 +88,7 @@ while [ "$valid_input" != true ]; do echo -e "\e[1A\e[K${OK} - Removed existing 'simple-sddm' directory from the current location." 2>&1 | tee -a "$LOG" fi - if git clone https://github.com/JaKooLit/simple-sddm.git 2>&1 | tee -a "$LOG"; then + if git clone https://github.com/JaKooLit/simple-sddm.git; then while [ ! -d "simple-sddm" ]; do sleep 1 done diff --git a/install-scripts/swappy.sh b/install-scripts/swappy.sh old mode 100644 new mode 100755 index d93f858..3d8d3bf --- a/install-scripts/swappy.sh +++ b/install-scripts/swappy.sh @@ -1,44 +1,45 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# swappy - for screenshot) # -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_swappy.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_swappy2.log" +MLOG="install-$(date +%d-%H%M%S)_swappy.log" printf "${NOTE} Installing swappy..\n" -# Check if Hyprland folder exists and remove it +# Check if swappy folder exists if [ -d "swappy" ]; then - printf "${NOTE} Removing existing swappy folder...\n" - rm -rf "swappy" 2>&1 | tee -a "$LOG" + printf "${NOTE} swappy folder exists. Pulling latest changes...\n" + cd swappy || exit 1 + git pull origin master 2>&1 | tee -a "$MLOG" +else + printf "${NOTE} Cloning swappy repository...\n" + if git clone https://github.com/jtheoof/swappy.git; then + cd swappy || exit 1 + else + echo -e "${ERROR} Download failed for swappy" 2>&1 | tee -a "$LOG" + exit 1 + fi fi -if git clone https://github.com/jtheoof/swappy.git; then - cd swappy || exit 1 - meson build - ninja -C build - sudo ninja -C build install 2>&1 | tee -a "$LOG" - # Return to the previous directory - cd - || exit 1 -else - echo -e "${ERROR} Download failed for swappy" 2>&1 | tee -a "$LOG" -fi +# Proceed with the installation steps +meson build +ninja -C build +sudo ninja -C build install 2>&1 | tee -a "$MLOG" + +# Moving logs into main Install-Logs +mv "$MLOG" ../Install-Logs/ || true +cd - || exit 1 clear diff --git a/install-scripts/swaylock-effects.sh b/install-scripts/swaylock-effects.sh old mode 100644 new mode 100755 index c623037..ed2e99e --- a/install-scripts/swaylock-effects.sh +++ b/install-scripts/swaylock-effects.sh @@ -1,44 +1,44 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Swaylock Effects # -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_swaylock-effects.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_swaylock-effects2.log" +MLOG="install-$(date +%d-%H%M%S)_swaylock-effects.log" printf "${NOTE} Installing swaylock-effects\n" - -# Check if swaylock-effects folder exists and remove it +# Check if swaylock-effects folder exists if [ -d "swaylock-effects" ]; then - printf "${NOTE} Removing existing swaylock-effects folder...\n" - rm -rf "swaylock-effects" 2>&1 | tee -a "$LOG" -fi - -if git clone https://github.com/mortie/swaylock-effects.git; then + printf "${NOTE} swaylock-effects folder exists. Pulling latest changes...\n" cd swaylock-effects || exit 1 - meson build - ninja -C build - sudo ninja -C build install 2>&1 | tee -a "$LOG" - # Return to the previous directory - cd - || exit 1 + git pull origin master 2>&1 | tee -a "$MLOG" else - echo -e "${ERROR} Download failed for swaylock-effects" 2>&1 | tee -a "$LOG" + printf "${NOTE} Cloning swaylock-effects repository...\n" + if git clone https://github.com/jirutka/swaylock-effects.git; then + cd swaylock-effects || exit 1 + else + echo -e "${ERROR} Download failed for swaylock-effects" 2>&1 | tee -a "$LOG" + exit 1 + fi fi -clear +# Proceed with the installation steps +meson build +ninja -C build +sudo ninja -C build install 2>&1 | tee -a "$MLOG" + +# Moving logs into main Install-Logs +mv "$MLOG" ../Install-Logs/ || true +cd - || exit 1 + +clear \ No newline at end of file diff --git a/install-scripts/swww.sh b/install-scripts/swww.sh old mode 100644 new mode 100755 index 4a69d49..d927ddb --- a/install-scripts/swww.sh +++ b/install-scripts/swww.sh @@ -1,56 +1,55 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# SWWW - Wallpaper Utility # -############## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING! ############## - +## 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)" +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 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +'%d-%H%M%S')_swww.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_swww2.log" +MLOG="install-$(date +%d-%H%M%S)_swww.log" printf "${NOTE} Installing swww\n" -# Check if swww folder exists and remove it +# Check if swww folder exists if [ -d "swww" ]; then - printf "${NOTE} Removing existing swww folder...\n" - rm -rf "swww" 2>&1 | tee -a "$LOG" -fi - -if git clone https://github.com/Horus645/swww.git 2>&1 | tee -a "$LOG"; then + printf "${NOTE} swww folder exists. Pulling latest changes...\n" cd swww || exit 1 - source "$HOME/.cargo/env" - cargo build --release 2>&1 | tee -a "$LOG" - # Copy binaries to /usr/bin/ - sudo cp target/release/swww /usr/bin/ 2>&1 | tee -a "$LOG" - sudo cp target/release/swww-daemon /usr/bin/ 2>&1 | tee -a "$LOG" - - # Copy bash completions - sudo mkdir -p /usr/share/bash-completion/completions 2>&1 | tee -a "$LOG" - sudo cp completions/swww.bash /usr/share/bash-completion/completions/swww 2>&1 | tee -a "$LOG" - - # Copy zsh completions - sudo mkdir -p /usr/share/zsh/site-functions 2>&1 | tee -a "$LOG" - sudo cp completions/_swww /usr/share/zsh/site-functions/_swww 2>&1 | tee -a "$LOG" - - # Return to the previous directory - cd - || exit 1 + git pull origin main 2>&1 | tee -a "$MLOG" else - echo -e "${ERROR} Download failed for swww" 2>&1 | tee -a "$LOG" + printf "${NOTE} Cloning swww repository...\n" + if git clone https://github.com/Horus645/swww.git; then + cd swww || exit 1 + else + echo -e "${ERROR} Download failed for swww" 2>&1 | tee -a "$LOG" + exit 1 + fi fi +# Proceed with the rest of the installation steps +source "$HOME/.cargo/env" +cargo build --release 2>&1 | tee -a "$MLOG" +# Copy binaries to /usr/bin/ +sudo cp target/release/swww /usr/bin/ 2>&1 | tee -a "$MLOG" +sudo cp target/release/swww-daemon /usr/bin/ 2>&1 | tee -a "$MLOG" + +# Copy bash completions +sudo mkdir -p /usr/share/bash-completion/completions 2>&1 | tee -a "$MLOG" +sudo cp completions/swww.bash /usr/share/bash-completion/completions/swww 2>&1 | tee -a "$MLOG" + +# Copy zsh completions +sudo mkdir -p /usr/share/zsh/site-functions 2>&1 | tee -a "$MLOG" +sudo cp completions/_swww /usr/share/zsh/site-functions/_swww 2>&1 | tee -a "$MLOG" + +# Moving logs into main Install-Logs +mv "$MLOG" ../Install-Logs/ || true +cd - || exit 1 clear diff --git a/install-scripts/thunar.sh b/install-scripts/thunar.sh old mode 100644 new mode 100755 index 877c8b3..de305b2 --- a/install-scripts/thunar.sh +++ b/install-scripts/thunar.sh @@ -1,7 +1,10 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Thunar # thunar=( ffmpegthumbnailer +file-roller thunar thunar-volman tumbler @@ -9,7 +12,7 @@ thunar-archive-plugin xarchiver ) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -17,40 +20,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_thunar.log" - -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} +LOG="Install-Logs/install-$(date +%d-%H%M%S)_thunar.log" printf "${NOTE} Installing Thunar Packages...\n" for THUNAR in "${thunar[@]}"; do @@ -58,18 +31,15 @@ printf "${NOTE} Installing Thunar Packages...\n" [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $THUNAR install had failed, please check the install.log"; exit 1; } done - # Check for existing config folders and backup - for DIR1 in Thunar xfce4; do - DIRPATH=~/.config/$DIR1 - if [ -d "$DIRPATH" ]; then - echo -e "${NOTE} Config for $DIR1 found, backing up." - mv $DIRPATH $DIRPATH-back-up 2>&1 | tee -a "$LOG" - echo -e "${NOTE} Backed up $DIR1 to $DIRPATH-back-up." - fi - done - -# copying from assets -cp -r assets/xfce4 ~/.config/ && echo "Copy xfce4 completed!" || echo "Error: Failed to copy xfce4 config files." 2>&1 | tee -a "$LOG" -cp -r assets/Thunar ~/.config/ && echo "Copy Thunar completed!" || echo "Error: Failed to copy Thunar config files." 2>&1 | tee -a "$LOG" + # Check for existing configs and copy if does not exist +for DIR1 in Thunar xfce4; do + DIRPATH=~/.config/$DIR1 + if [ -d "$DIRPATH" ]; then + echo -e "${NOTE} Config for $DIR1 found, no need to copy." 2>&1 | tee -a "$LOG" + else + echo -e "${NOTE} Config for $DIR1 not found, copying from assets." 2>&1 | tee -a "$LOG" + cp -r assets/$DIR1 ~/.config/ && echo "Copy $DIR1 completed!" || echo "Error: Failed to copy $DIR1 config files." 2>&1 | tee -a "$LOG" + fi +done clear diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh old mode 100644 new mode 100755 index 8216b7e..0757ef9 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -1,7 +1,12 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# XDG-Desktop-Portals # +xdg=( +xdg-desktop-portal-gtk +) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -9,59 +14,79 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_xdph.log" +LOG="Install-Logs/install-$(date +%d-%H%M%S)_xdph.log" +MLOG="install-$(date +%d-%H%M%S)_xdph2.log" +## +printf "${NOTE} Installing xdg-desktop-portal-gtk...\n" +for portal in "${xdg[@]}"; do + install_package "$portal" 2>&1 | tee -a "$LOG" + [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $portal install had failed, please check the install.log"; exit 1; } +done # Check if xdg-desktop-portal-hyprland folder exists and remove it if [ -d "xdg-desktop-portal-hyprland" ]; then - printf "${NOTE} Removing existing xdg-desktop-portal-hyprland folder...\n" - rm -rf "xdg-desktop-portal-hyprland" 2>&1 | tee -a "$LOG" + printf "${NOTE} Removing existing xdg-desktop-portal-hyprland folder...\n" + rm -rf "xdg-desktop-portal-hyprland" fi # Clone and build xdg-desktop-portal-hyprland printf "${NOTE} Installing xdg-desktop-portal-hyprland...\n" -if git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland 2>&1 | tee -a "$LOG"; then - cd xdg-desktop-portal-hyprland || exit 1 - make all - if sudo make install 2>&1 | tee -a "$LOG"; then - printf "${OK} xdg-desktop-portal-hyprland installed successfully.\n" - # Return to the previous directory +if git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland; then + cd xdg-desktop-portal-hyprland || exit 1 + make all + if sudo make install 2>&1 | tee -a "$MLOG" ; then + printf "${OK} xdg-desktop-portal-hyprland installed successfully.\n" 2>&1 | tee -a "$MLOG" + else + echo -e "${ERROR} Installation failed for xdg-desktop-portal-hyprland." 2>&1 | tee -a "$MLOG" + fi + #moving the addional logs to Install-Logs directory + mv $MLOG ../Install-Logs/ || true cd .. - else - echo -e "${ERROR} Installation failed for xdg-desktop-portal-hyprland." - fi else - echo -e "${ERROR} Download failed for xdg-desktop-portal-hyprland." + echo -e "${ERROR} Download failed for xdg-desktop-portal-hyprland." 2>&1 | tee -a "$MLOG" + mv $MLOG Install-Logs/ || true fi -printf "\n\n\n" +printf "\n\n" +printf "${NOTE} Checking for other XDG-Desktop-Portal-Implementations....\n" +sleep 1 +printf "\n" +printf "${NOTE} XDG-desktop-portal-KDE & GNOME (if installed) should be manually disabled or removed! I can't remove it... sorry...\n" +while true; do + read -rp "${CAT} Would you like to try to remove other XDG-Desktop-Portal-Implementations? (y/n) " XDPH1 + echo + sleep 1 - # Clean out other portals - printf "${NOTE} Clearing any other xdg-desktop-portal implementations...\n" - # Check if packages are installed and uninstall if present - if sudo apt-get list installed xdg-desktop-portal-gnome &>> /dev/null; then - echo "Removing xdg-desktop-portal-gnome..." - sudo apt-get remove -y xdg-desktop-portal-gnome 2>&1 | tee -a "$LOG" - fi - if sudo apt-get list installed xdg-desktop-portal-wlr &>> /dev/null; then - echo "Removing xdg-desktop-portal-wlr..." - sudo apt-get remove -y xdg-desktop-portal-wlr 2>&1 | tee -a "$LOG" - fi - if sudo apt-get list installed xdg-desktop-portal-lxqt &>> /dev/null; then - echo "Removing xdg-desktop-portal-lxqt..." - sudo apt-get remove -y xdg-desktop-portal-lxqt 2>&1 | tee -a "$LOG" - fi + case $XDPH1 in + [Yy]) + # Clean out other portals + printf "${NOTE} Clearing any other xdg-desktop-portal implementations...\n" + # Check if packages are installed and uninstall if present + if sudo apt-get list installed xdg-desktop-portal-wlr &>> /dev/null; then + echo "Removing xdg-desktop-portal-wlr..." + sudo apt-get remove -y xdg-desktop-portal-wlr 2>&1 | tee -a "$LOG" + fi + + if sudo apt-get list installed xdg-desktop-portal-lxqt &>> /dev/null; then + echo "Removing xdg-desktop-portal-lxqt..." + sudo apt-get remove -y xdg-desktop-portal-lxqt 2>&1 | tee -a "$LOG" + fi + break + ;; + [Nn]) + echo "no other XDG-implementations will be removed." 2>&1 | tee -a "$LOG" + break + ;; + + *) + echo "Invalid input. Please enter 'y' for yes or 'n' for no." + ;; + esac +done +clear -clear \ No newline at end of file diff --git a/install-scripts/zsh.sh b/install-scripts/zsh.sh old mode 100644 new mode 100755 index 14f87e5..f06e49d --- a/install-scripts/zsh.sh +++ b/install-scripts/zsh.sh @@ -1,7 +1,12 @@ #!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Zsh and Oh my Zsh + Optional Pokemon ColorScripts# +zsh=( +zsh +) -############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ###################################### +## 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 )" @@ -9,80 +14,84 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || exit 1 -# 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) +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time -LOG="install-$(date +%d-%H%M%S)_zsh.log" - -set -e - -# Function for installing packages -install_package() { - # Checking if package is already installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "${OK} $1 is already installed. Skipping..." - else - # Package not installed - echo -e "${NOTE} Installing $1 ..." - sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG" - # Making sure the package is installed - if sudo dpkg -l | grep -q -w "$1" ; then - echo -e "\e[1A\e[K${OK} $1 was installed." - else - # Something is missing, exiting to review the 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 -} - -# Check if the oh-my-zsh directory exists -if [ -d "$HOME/.oh-my-zsh" ]; then - printf "${NOTE} Oh My Zsh found. Creating a backup before uninstalling...${RESET}\n" - # Perform backup using cp -r and create a backup directory with -backup suffix - cp -r "$HOME/.oh-my-zsh" "$HOME/.oh-my-zsh-backup" || true - mv "$HOME/.zshrc" "$HOME/.zshrc-backup" || true - - printf "${NOTE} Backup created....${RESET}\n" -fi +LOG="Install-Logs/install-$(date +%d-%H%M%S)_zsh.log" +# Check if the log file already exists, if yes, append a counter to make it unique +COUNTER=1 +while [ -f "$LOG" ]; do + LOG="Install-Logs/install-$(date +%d-%H%M%S)_${COUNTER}_zsh.log" + ((COUNTER++)) +done # Installing zsh packages printf "${NOTE} Installing core zsh packages...${RESET}\n" -for ZSH in zsh; do - install_package "$ZSH" 2>&1 | tee -a "$LOG" +for ZSHP in "${zsh[@]}"; do + install_package "$ZSHP" 2>&1 | tee -a "$LOG" if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $ZSH install had failed, please check the install.log" + echo -e "\e[1A\e[K${ERROR} - $ZSHP install had failed, please check the install.log" fi done +printf "\n" + +## Optional Pokemon color scripts +while true; do + read -p "${CAT} Do you want to install Pokemon color scripts? (y/n): " choice + case "$choice" in + [Yy]*) + if [ -d "pokemon-colorscripts" ]; then + cd pokemon-colorscripts && git pull && sudo ./install.sh && cd .. + else + git clone https://gitlab.com/phoneybadger/pokemon-colorscripts.git && + cd pokemon-colorscripts && sudo ./install.sh && cd .. + fi + sed -i '/#pokemon-colorscripts --no-title -s -r/s/^#//' assets/.zshrc >> "$LOG" 2>&1 + echo "${NOTE} Pokemon Installation process completed" 2>&1 | tee -a "$LOG" + break + ;; + [Nn]*) + echo "${ORANGE} You chose not to install Pokemon Color Scripts." 2>&1 | tee -a "$LOG" + break + ;; + *) + echo "Please enter 'y' for yes or 'n' for no." 2>&1 | tee -a "$LOG" + ;; + esac +done + +printf "\n" + # Install Oh My Zsh, plugins, and set zsh as default shell if command -v zsh >/dev/null; then printf "${NOTE} Installing Oh My Zsh and plugins...\n" if [ ! -d "$HOME/.oh-my-zsh" ]; then sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || true else - echo "Directory .oh-my-zsh already exists. Skipping re-installation." + echo "Directory .oh-my-zsh already exists. Skipping re-installation." 2>&1 | tee -a "$LOG" fi # Check if the directories exist before cloning the repositories - if [ ! -d "$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then + if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions || true else - echo "Directory zsh-autosuggestions already exists. Skipping cloning." + echo "Directory zsh-autosuggestions already exists. Skipping cloning." 2>&1 | tee -a "$LOG" fi - if [ ! -d "$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" ]; then + if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting || true else - echo "Directory zsh-syntax-highlighting already exists. Skipping cloning." + echo "Directory zsh-syntax-highlighting already exists. Skipping cloning." 2>&1 | tee -a "$LOG" + fi + + # Check if ~/.zshrc and .zprofile exists, create a backup, and copy the new configuration + if [ -f "$HOME/.zshrc" ]; then + cp -b "$HOME/.zshrc" "$HOME/.zshrc-backup" || true + fi + + if [ -f "$HOME/.zprofile" ]; then + cp -b "$HOME/.zprofile" "$HOME/.zprofile-backup" || true fi cp -r 'assets/.zshrc' ~/ @@ -91,27 +100,12 @@ if command -v zsh >/dev/null; then printf "${NOTE} Changing default shell to zsh...\n" while ! chsh -s $(which zsh); do - echo "${ERROR} Authentication failed. Please enter the correct password." - sleep 1 + echo "${ERROR} Authentication failed. Please enter the correct password." + sleep 1 done + printf "\n" printf "${NOTE} Shell changed successfully to zsh.\n" 2>&1 | tee -a "$LOG" fi - printf "\n\n\n\n" - -# Pokemon Colorscripts -printf "${NOTE} Installing Pokemon-Colorscripts.\n" - -# Check if directory 'pokemon-colorscripts' exists -if [ -d "pokemon-colorscripts" ]; then - echo "${OK} Directory 'pokemon-colorscripts' exists. Pulling changes..." 2>&1 | tee -a "$LOG" - cd pokemon-colorscripts && git pull 2>&1 | tee -a "$LOG" - sudo ./install.sh 2>&1 | tee -a "$LOG" -else - git clone https://gitlab.com/phoneybadger/pokemon-colorscripts.git 2>&1 | tee -a "$LOG" - cd pokemon-colorscripts && sudo ./install.sh 2>&1 | tee -a "$LOG" -fi - -cd .. clear diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 16a4b71..c97113f --- a/install.sh +++ b/install.sh @@ -47,6 +47,11 @@ if [ "$proceed2" != "y" ]; then exit 1 fi +# Create Directory for Install Logs +if [ ! -d Install-Logs ]; then + mkdir Install-Logs +fi + # Set some colors for output messages OK="$(tput setaf 2)[OK]$(tput sgr0)" ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" @@ -129,7 +134,7 @@ execute_script() { # Collect user responses to all questions printf "\n" -ask_yes_no "-Do you have nvidia gpu?" nvidia +ask_yes_no "-Do you have any nvidia gpu in your system?" nvidia printf "\n" ask_yes_no "-Install GTK themes (required for Dark/Light function)?" gtk_themes printf "\n" @@ -137,20 +142,21 @@ ask_yes_no "-Do you want to configure Bluetooth?" bluetooth printf "\n" ask_yes_no "-Do you want to install Thunar file manager?" thunar printf "\n" -ask_yes_no "-Installing on Asus ROG Laptops?" rog -printf "\n" -ask_yes_no "-Install and configure SDDM log-in Manager?" sddm +ask_yes_no "-Install & configure SDDM log-in Manager plus (OPTIONAL) SDDM Theme?" sddm printf "\n" ask_yes_no "-Install XDG-DESKTOP-PORTAL-HYPRLAND? (For proper Screen Share ie OBS)" xdph printf "\n" -ask_yes_no "-Install zsh, oh-my-zsh & pokemon-colorscripts?" zsh +ask_yes_no "-Install zsh & oh-my-zsh plus (OPTIONAL) pokemon-colorscripts for tty?" zsh printf "\n" ask_yes_no "-Install swaylock-effects? (recommended - for screen locks)" swaylock printf "\n" -ask_yes_no "-Do you want to install nwg-look? (GTK Theming app - lxappearance-like)" nwg +ask_yes_no "-Install nwg-look? (a GTK Theming app - lxappearance-like) WARN! This Package Takes long time to build!" nwg printf "\n" -ask_yes_no "-Do you want to copy Hyprland dotfiles?" dots +ask_yes_no "-Installing on Asus ROG Laptops?" rog printf "\n" +ask_yes_no "-Do you want to download and install pre-configured Hyprland-dotfiles?" dots +printf "\n" + # Ensuring all in the scripts folder are made executable chmod +x install-scripts/* @@ -187,10 +193,6 @@ if [ "$thunar" == "Y" ]; then execute_script "thunar.sh" fi -if [ "$rog" == "Y" ]; then - execute_script "rog.sh" -fi - if [ "$sddm" == "Y" ]; then execute_script "sddm.sh" fi @@ -211,11 +213,22 @@ if [ "$nwg" == "Y" ]; then execute_script "nwg-look.sh" fi +if [ "$rog" == "Y" ]; then + execute_script "rog.sh" +fi + execute_script "InputGroup.sh" if [ "$dots" == "Y" ]; then execute_script "dotfiles.sh" +fi +# Clean up +printf "\n${OK} performing some clean up.\n" +if [ -e "JetBrainsMono.tar.xz" ]; then + echo "JetBrainsMono.tar.xz found. Deleting..." + rm JetBrainsMono.tar.xz + echo "JetBrainsMono.tar.xz deleted successfully." fi clear