diff --git a/install-scripts/00-dependencies.sh b/install-scripts/00-dependencies.sh index f2371de..a7a54c5 100755 --- a/install-scripts/00-dependencies.sh +++ b/install-scripts/00-dependencies.sh @@ -2,7 +2,7 @@ # 💫 https://github.com/JaKooLit 💫 # # main dependencies # -# packages neeeded +# packages needed dependencies=( build-essential cmake @@ -114,11 +114,11 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_dependencies.log" printf "\n%s - Installing main dependencies.... \n" "${NOTE}" for PKG1 in "${dependencies[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done # Remove Ubuntu default Rust Install diff --git a/install-scripts/00-hypr-pkgs.sh b/install-scripts/00-hypr-pkgs.sh index 810cd93..7637023 100755 --- a/install-scripts/00-hypr-pkgs.sh +++ b/install-scripts/00-hypr-pkgs.sh @@ -10,55 +10,55 @@ Extra=( ) -# packages neeeded -hypr_package=( - cliphist - grim - gvfs - gvfs-backends - inxi - kitty - nano - pavucontrol - playerctl - polkit-kde-agent-1 - python3-requests - python3-pip - qt5ct - qt5-style-kvantum - qt5-style-kvantum-themes - qt6ct - slurp - sway-notification-center - waybar - wget - wl-clipboard - wlogout - xdg-user-dirs - xdg-utils - yad +# packages needed +hypr_package=( + cliphist + grim + gvfs + gvfs-backends + inxi + kitty + nano + pavucontrol + playerctl + polkit-kde-agent-1 + python3-requests + python3-pip + qt5ct + qt5-style-kvantum + qt5-style-kvantum-themes + qt6ct + slurp + sway-notification-center + waybar + wget + wl-clipboard + wlogout + xdg-user-dirs + xdg-utils + yad ) # the following packages can be deleted. however, dotfiles may not work properly hypr_package_2=( - brightnessctl - btop - cava - eog - gnome-system-monitor - mousepad - mpv - mpv-mpris - nvtop - pamixer - qalculate-gtk - vim + brightnessctl + btop + cava + eog + gnome-system-monitor + mousepad + mpv + mpv-mpris + nvtop + pamixer + qalculate-gtk + vim ) # List of packages to uninstall as it conflicts with swaync or causing swaync to not function properly uninstall=( - dunst - mako + dunst + mako ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -78,21 +78,21 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypr-pkgs.log" printf "\n%s - Installing hyprland packages.... \n" "${NOTE}" for PKG1 in "${hypr_package[@]}" "${hypr_package_2[@]}" "${Extra[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done printf "\n%s - Checking if mako or dunst are installed and removing for swaync to work properly \n" "${NOTE}" for PKG in "${uninstall[@]}"; do - uninstall_package "$PKG" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG uninstallation had failed, please check the log" - exit 1 - fi + uninstall_package "$PKG" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG uninstallation had failed, please check the log" + exit 1 + fi done ## making brightnessctl work diff --git a/install-scripts/Global_functions.sh b/install-scripts/Global_functions.sh index 287feb9..ad8a452 100755 --- a/install-scripts/Global_functions.sh +++ b/install-scripts/Global_functions.sh @@ -19,42 +19,41 @@ 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." + # Checking if package is already installed + if sudo dpkg -l | grep -q -w "$1"; then + echo -e "${OK} $1 is already installed. Skipping..." 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 + # 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 - 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 ..." + # 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 + # 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 + # 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 - fi } diff --git a/install-scripts/InputGroup.sh b/install-scripts/InputGroup.sh index 7b4b837..9cd9211 100755 --- a/install-scripts/InputGroup.sh +++ b/install-scripts/InputGroup.sh @@ -49,4 +49,4 @@ while true; do fi done -clear \ No newline at end of file +clear diff --git a/install-scripts/ags.sh b/install-scripts/ags.sh index 1ed54d9..422b712 100755 --- a/install-scripts/ags.sh +++ b/install-scripts/ags.sh @@ -1,18 +1,18 @@ -7#!/bin/bash +#!/bin/bash # 💫 https://github.com/JaKooLit 💫 # # Aylur's GTK Shell # ags=( -node-typescript -npm -meson -libgjs-dev -gjs -libgtk-layer-shell-dev -libgtk-3-dev -libpulse-dev -libdbusmenu-gtk3-dev -libsoup-3.0-dev + node-typescript + npm + meson + libgjs-dev + gjs + libgtk-layer-shell-dev + libgtk-3-dev + libpulse-dev + libdbusmenu-gtk3-dev + libsoup-3.0-dev ) # specific tags to download @@ -34,18 +34,17 @@ MLOG="install-$(date +%d-%H%M%S)_ags.log" # Installing ags Dependencies for PKG1 in "${ags[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done -#install typescript by npm +# Install typescript by npm sudo npm install --global typescript 2>&1 | tee -a "$LOG" # ags - printf "${NOTE} Install and Compiling Aylurs GTK shell\n" # Check if folder exists and remove it @@ -58,8 +57,8 @@ fi if git clone --recursive -b "$ags_tag" --depth 1 https://github.com/Aylur/ags.git; then cd ags || exit 1 # Build and install ags - npm install - meson setup build + npm install + meson setup build if sudo meson install -C build 2>&1 | tee -a "$MLOG"; then printf "${OK} ags installed successfully.\n" 2>&1 | tee -a "$MLOG" else @@ -75,3 +74,4 @@ else exit 1 fi +clear diff --git a/install-scripts/bluetooth.sh b/install-scripts/bluetooth.sh index 4286088..9194c06 100755 --- a/install-scripts/bluetooth.sh +++ b/install-scripts/bluetooth.sh @@ -3,8 +3,8 @@ # Bluetooth # blue=( -bluez -blueman + bluez + blueman ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -22,10 +22,13 @@ 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 Package installation failed, Please check the installation logs"; exit 1; } - done +for BLUE in "${blue[@]}"; do + install_package "$BLUE" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $BLUE Package installation failed, Please check the installation logs" + exit 1 + fi +done printf " Activating Bluetooth Services...\n" sudo systemctl enable --now bluetooth.service 2>&1 | tee -a "$LOG" diff --git a/install-scripts/cliphist.sh b/install-scripts/cliphist.sh index ca7937b..684f2c1 100755 --- a/install-scripts/cliphist.sh +++ b/install-scripts/cliphist.sh @@ -2,7 +2,7 @@ # 💫 https://github.com/JaKooLit 💫 # # Cliphist install using go # -## This is to be be use for Ubuntu 23.10 only +## This is to be be used for Ubuntu 23.10 only # it is disabled by default. Enable it on install.sh #execute_script "cliphist.sh" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -21,9 +21,9 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_cliphist.log" # Install cliphist using go (for UBUNTU 23.10 users) printf "\n%s - Installing cliphist using go.... \n" "${NOTE}" export PATH=$PATH:/usr/local/bin -go install go.senan.xyz/cliphist@latest 2>&1 | tee -a "$LOG" +go install go.senan.xyz/cliphist@latest 2>&1 | tee -a "$LOG" -# copy cliphist into /usr/local/bin for some reason it is installing in ~/go/bin -sudo cp -r "$HOME/go/bin/cliphist" "/usr/local/bin/" 2>&1 | tee -a "$LOG" +# Copy cliphist into /usr/local/bin for some reason it is installing in ~/go/bin +sudo cp -r "$HOME/go/bin/cliphist" "/usr/local/bin/" 2>&1 | tee -a "$LOG" clear diff --git a/install-scripts/dotfiles.sh b/install-scripts/dotfiles.sh index e471084..f36f366 100755 --- a/install-scripts/dotfiles.sh +++ b/install-scripts/dotfiles.sh @@ -13,9 +13,9 @@ printf "${NOTE} Downloading / Checking for existing Hyprland-Dots-${specific_ver # Check if the specific release tarball exists if [ -f "Hyprland-Dots-${specific_version}.tar.gz" ]; then - printf "${NOTE} Hyprland-Dots-${specific_version}.tar.gz found.\n" - echo -e "${OK} Hyprland-Dots-${specific_version}.tar.gz is already downloaded." - exit 0 + printf "${NOTE} Hyprland-Dots-${specific_version}.tar.gz found.\n" + echo -e "${OK} Hyprland-Dots-${specific_version}.tar.gz is already downloaded." + exit 0 fi printf "${NOTE} Downloading the Hyprland-Dots-${specific_version} source code release...\n" @@ -23,8 +23,8 @@ printf "${NOTE} Downloading the Hyprland-Dots-${specific_version} source code re # Fetch the tag name for the specific release using the GitHub API release_info=$(curl -s "https://api.github.com/repos/JaKooLit/Hyprland-Dots/releases/tags/${specific_version}") if [ -z "$release_info" ]; then - echo -e "${ERROR} Unable to fetch information for release ${specific_version}." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" - exit 1 + echo -e "${ERROR} Unable to fetch information for release ${specific_version}." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" + exit 1 fi # Get the tarball URL for the specific release @@ -32,34 +32,34 @@ tarball_url=$(echo "$release_info" | grep "tarball_url" | cut -d '"' -f 4) # Check if the URL is obtained successfully if [ -z "$tarball_url" ]; then - echo -e "${ERROR} Unable to fetch the tarball URL for release ${specific_version}." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" - exit 1 + echo -e "${ERROR} Unable to fetch the tarball URL for release ${specific_version}." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" + exit 1 fi # Download the specific release source code tarball to the current directory if curl -L "$tarball_url" -o "Hyprland-Dots-${specific_version}.tar.gz"; then - # Extract the contents of the tarball - tar -xzf "Hyprland-Dots-${specific_version}.tar.gz" || exit 1 + # Extract the contents of the tarball + tar -xzf "Hyprland-Dots-${specific_version}.tar.gz" || exit 1 - # Delete existing Hyprland-Dots - rm -rf JaKooLit-Hyprland-Dots + # Delete existing Hyprland-Dots + rm -rf JaKooLit-Hyprland-Dots - # Identify the extracted directory - extracted_directory=$(tar -tf "Hyprland-Dots-${specific_version}.tar.gz" | grep -o '^[^/]\+' | uniq) + # Identify the extracted directory + extracted_directory=$(tar -tf "Hyprland-Dots-${specific_version}.tar.gz" | grep -o '^[^/]\+' | uniq) - # Rename the extracted directory to JaKooLit-Hyprland-Dots - mv "$extracted_directory" JaKooLit-Hyprland-Dots || exit 1 + # Rename the extracted directory to JaKooLit-Hyprland-Dots + mv "$extracted_directory" JaKooLit-Hyprland-Dots || exit 1 - cd "JaKooLit-Hyprland-Dots" || exit 1 + cd "JaKooLit-Hyprland-Dots" || exit 1 - # Set execute permission for copy.sh and execute it - chmod +x copy.sh - ./copy.sh + # Set execute permission for copy.sh and execute it + chmod +x copy.sh + ./copy.sh - echo -e "${OK} Hyprland-Dots-${specific_version} 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" + echo -e "${OK} Hyprland-Dots-${specific_version} 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 Hyprland-Dots-${specific_version} release." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" - exit 1 + echo -e "${ERROR} Failed to download Hyprland-Dots-${specific_version} release." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log" + exit 1 fi clear diff --git a/install-scripts/fonts.sh b/install-scripts/fonts.sh index 093ac55..90b3261 100755 --- a/install-scripts/fonts.sh +++ b/install-scripts/fonts.sh @@ -3,11 +3,11 @@ # Fonts Required # fonts=( -fonts-firacode -fonts-font-awesome -fonts-noto -fonts-noto-cjk -fonts-noto-color-emoji + fonts-firacode + fonts-font-awesome + fonts-noto + fonts-noto-cjk + fonts-noto-color-emoji ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -27,11 +27,11 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_fonts.log" printf "\n%s - Installing fonts.... \n" "${NOTE}" for PKG1 in "${fonts[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done # jetbrains nerd font. Necessary for waybar diff --git a/install-scripts/gtk_themes.sh b/install-scripts/gtk_themes.sh index 876c51e..4b88b42 100755 --- a/install-scripts/gtk_themes.sh +++ b/install-scripts/gtk_themes.sh @@ -1,6 +1,6 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# GTK Themes & ICONS and Sourcing from a different Repo # +# GTK Themes & ICONS and Sourcing from a different Repo # engine=( unzip @@ -20,8 +20,7 @@ source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_themes.log" - -# installing engine needed for gtk themes +# Installing engine needed for GTK themes for PKG1 in "${engine[@]}"; do install_package "$PKG1" 2>&1 | tee -a "$LOG" if [ $? -ne 0 ]; then @@ -37,7 +36,7 @@ if [ -d "GTK-themes-icons" ]; then fi echo "$NOTE Cloning GTK themes and Icons repository..." 2>&1 | tee -a "$LOG" -if git clone https://github.com/JaKooLit/GTK-themes-icons.git ; 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 @@ -50,4 +49,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 \ No newline at end of file +clear diff --git a/install-scripts/hypr-eco.sh b/install-scripts/hypr-eco.sh index 9efd113..015f6e3 100755 --- a/install-scripts/hypr-eco.sh +++ b/install-scripts/hypr-eco.sh @@ -1,11 +1,11 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# This is to be use for installing hyprland plugins +# This is to be used for installing hyprland plugins # Hyprland plugins: pyprland pypr_depend=( -python3-aiofiles -python-is-python3 + python3-aiofiles + python-is-python3 ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -23,12 +23,14 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypr_eco.log" # Pyprland printf "${NOTE} Installing Pyprland Dependencies...\n" - for PYPR in "${pypr_depend[@]}"; do - install_package "$PYPR" 2>&1 | tee -a "$LOG" - [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $PYPR Package installation failed, Please check the installation logs"; exit 1; } - done +for PYPR in "${pypr_depend[@]}"; do + install_package "$PYPR" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PYPR Package installation failed, Please check the installation logs" + exit 1 + fi +done - # Check if the file exists and delete it pypr="/usr/local/bin/pypr" if [ -f "$pypr" ]; then @@ -39,8 +41,8 @@ fi # pyprland https://github.com/hyprland-community/pyprland installing using python printf "${NOTE} Installing pyprland\n" -curl https://raw.githubusercontent.com/hyprland-community/pyprland/main/scripts/get-pypr | sh 2>&1 | tee -a "$LOG" +curl https://raw.githubusercontent.com/hyprland-community/pyprland/main/scripts/get-pypr | sh 2>&1 | tee -a "$LOG" -pip install pyprland --break-system-packages 2>&1 | tee -a "$LOG" +pip install pyprland --break-system-packages 2>&1 | tee -a "$LOG" clear diff --git a/install-scripts/hyprcursor.sh b/install-scripts/hyprcursor.sh index eb88508..8747696 100755 --- a/install-scripts/hyprcursor.sh +++ b/install-scripts/hyprcursor.sh @@ -3,11 +3,11 @@ # hyprcursor # cursor=( -libzip-dev -librsvg2-dev + libzip-dev + librsvg2-dev ) -#specific branch or release +# specific branch or release cursor_tag="v0.1.8" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -28,11 +28,11 @@ MLOG="install-$(date +%d-%H%M%S)_hyprcursor.log" printf "\n%s - Installing hyprcursor dependencies.... \n" "${NOTE}" for PKG1 in "${cursor[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done # Check if hyprcursor folder exists and remove it @@ -43,22 +43,20 @@ fi # Clone and build printf "${NOTE} Installing hyprcursor...\n" -if git clone --recursive -b $cursor_tag https://github.com/hyprwm/hyprcursor.git; then +if git clone --recursive -b "$cursor_tag" https://github.com/hyprwm/hyprcursor.git; then cd hyprcursor || exit 1 - cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build - cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` - if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build + cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)" + if sudo cmake --install ./build 2>&1 | tee -a "$MLOG"; then printf "${OK} hyprcursor installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for hyprcursor." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for hyprcursor." 2>&1 | tee -a "$LOG" fi clear - - diff --git a/install-scripts/hypridle.sh b/install-scripts/hypridle.sh index f033cd5..214740a 100755 --- a/install-scripts/hypridle.sh +++ b/install-scripts/hypridle.sh @@ -1,12 +1,12 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# hypidle # +# hypridle # idle=( -libsdbus-c++-dev + libsdbus-c++-dev ) -#specific branch or release +# specific branch or release idle_tag="v0.1.2" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -27,11 +27,11 @@ MLOG="install-$(date +%d-%H%M%S)_hypridle.log" printf "\n%s - Installing hypridle dependencies.... \n" "${NOTE}" for PKG1 in "${idle[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done # Check if hypridle folder exists and remove it @@ -42,22 +42,20 @@ fi # Clone and build printf "${NOTE} Installing hypridle...\n" -if git clone --recursive -b $idle_tag https://github.com/hyprwm/hypridle.git; then +if git clone --recursive -b "$idle_tag" https://github.com/hyprwm/hypridle.git; then cd hypridle || exit 1 - cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build - cmake --build ./build --config Release --target hypridle -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` - if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build + cmake --build ./build --config Release --target hypridle -j"$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)" + if sudo cmake --install ./build 2>&1 | tee -a "$MLOG"; then printf "${OK} hypridle installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for hypridle." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for hypridle." 2>&1 | tee -a "$LOG" fi clear - - diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh index fb210c8..f8cd01e 100755 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -2,8 +2,7 @@ # 💫 https://github.com/JaKooLit 💫 # # Main Hyprland Package# - -#specific branch or release +# specific branch or release hyprland_tag="v0.39.1" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -25,22 +24,22 @@ printf "${NOTE} Cloning Hyprland...\n" # Check if Hyprland folder exists and remove it if [ -d "Hyprland" ]; then - printf "${NOTE} Removing existing Hyprland folder...\n" - rm -rf "Hyprland" 2>&1 | tee -a "$LOG" + printf "${NOTE} Removing existing Hyprland folder...\n" + rm -rf "Hyprland" 2>&1 | tee -a "$LOG" fi -if git clone --recursive -b $hyprland_tag "https://github.com/hyprwm/Hyprland"; then - cd "Hyprland" || exit 1 - 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." 2>&1 | tee -a "$MLOG" - fi - mv $MLOG ../Install-Logs/ || true - cd .. +if git clone --recursive -b "$hyprland_tag" "https://github.com/hyprwm/Hyprland"; then + cd "Hyprland" || exit 1 + 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." 2>&1 | tee -a "$MLOG" + fi + mv "$MLOG" ../Install-Logs/ || true + cd .. else - echo -e "${ERROR} Download failed for Hyprland." 2>&1 | tee -a "$LOG" + echo -e "${ERROR} Download failed for Hyprland." 2>&1 | tee -a "$LOG" fi wayland_sessions_dir=/usr/share/wayland-sessions @@ -48,4 +47,3 @@ wayland_sessions_dir=/usr/share/wayland-sessions sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG" clear - diff --git a/install-scripts/hyprlang.sh b/install-scripts/hyprlang.sh index 95a19ee..7b58315 100755 --- a/install-scripts/hyprlang.sh +++ b/install-scripts/hyprlang.sh @@ -2,7 +2,7 @@ # 💫 https://github.com/JaKooLit 💫 # # hyprlang - hyprland and xdg-desktop-portal- dependencies # -#specific branch or release +# specific branch or release lang_tag="v0.5.1" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -20,7 +20,7 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprlang.log" MLOG="install-$(date +%d-%H%M%S)_hyprlang2.log" ## -printf "${NOTE} Installing hyprlang...\n" +printf "${NOTE} Installing hyprlang...\n" # Check if hyprlang folder exists and remove it if [ -d "hyprlang" ]; then @@ -30,22 +30,20 @@ fi # Clone and build hyprlang printf "${NOTE} Installing hyprlang...\n" -if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprlang.git; then +if git clone --recursive -b "$lang_tag" https://github.com/hyprwm/hyprlang.git; then cd hyprlang || exit 1 cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build - cmake --build ./build --config Release --target hyprlang -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` - if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then + cmake --build ./build --config Release --target hyprlang -j"$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)" + if sudo cmake --install ./build 2>&1 | tee -a "$MLOG"; then printf "${OK} hyprlang installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for hyprlang." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for hyprlang." 2>&1 | tee -a "$LOG" fi - clear - diff --git a/install-scripts/hyprlock.sh b/install-scripts/hyprlock.sh index 4640a1b..01d9632 100755 --- a/install-scripts/hyprlock.sh +++ b/install-scripts/hyprlock.sh @@ -3,10 +3,10 @@ # hyprlock # lock=( -libmagic-dev + libmagic-dev ) -#specific branch or release +# specific branch or release lock_tag="v0.3.0" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -27,14 +27,14 @@ MLOG="install-$(date +%d-%H%M%S)_hyprlock.log" printf "\n%s - Installing hyprlock dependencies.... \n" "${NOTE}" for PKG1 in "${lock[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done -# Check if hyprlidle folder exists and remove it +# Check if hyprlock folder exists and remove it if [ -d "hyprlock" ]; then printf "${NOTE} Removing existing hyprlock folder...\n" rm -rf "hyprlock" @@ -42,21 +42,20 @@ fi # Clone and build hyprlock printf "${NOTE} Installing hyprlock...\n" -if git clone --recursive -b $lock_tag https://github.com/hyprwm/hyprlock.git; then +if git clone --recursive -b "$lock_tag" https://github.com/hyprwm/hyprlock.git; then cd hyprlock || exit 1 - cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build - cmake --build ./build --config Release --target hyprlock -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` - if sudo cmake --install build 2>&1 | tee -a "$MLOG" ; then + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build + cmake --build ./build --config Release --target hyprlock -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" + if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then printf "${OK} hyprlock installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for hyprlock." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for hyprlock." 2>&1 | tee -a "$LOG" fi clear - diff --git a/install-scripts/imagemagick.sh b/install-scripts/imagemagick.sh index 9c0b492..1b9a9bd 100755 --- a/install-scripts/imagemagick.sh +++ b/install-scripts/imagemagick.sh @@ -3,10 +3,9 @@ # imagemagick from source # depend=( -build-essential + build-essential ) - ## 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 )" @@ -21,17 +20,16 @@ source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" LOG="Install-Logs/install-$(date +%d-%H%M%S)_image.log" MLOG="install-$(date +%d-%H%M%S)_image.log" -# Installing depencies +# Installing dependencies for PKG1 in "${depend[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done -## -printf "${NOTE} Installing ImageMagick from source...\n" +printf "${NOTE} Installing ImageMagick from source...\n" # Check if folder exists and remove it if [ -d "ImageMagick" ]; then @@ -43,16 +41,16 @@ fi printf "${NOTE} Installing ImageMagick...\n" if git clone --depth 1 https://github.com/ImageMagick/ImageMagick.git; then cd ImageMagick || exit 1 - ./configure - make - if sudo make install 2>&1 | tee -a "$MLOG" ; then - sudo ldconfig /usr/local/lib + ./configure + make + if sudo make install 2>&1 | tee -a "$MLOG"; then + sudo ldconfig /usr/local/lib printf "${OK} ImageMagick installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ImageMagick." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ImageMagick." 2>&1 | tee -a "$LOG" diff --git a/install-scripts/nvidia.sh b/install-scripts/nvidia.sh index 44c93b7..dd98044 100755 --- a/install-scripts/nvidia.sh +++ b/install-scripts/nvidia.sh @@ -4,9 +4,9 @@ # UBUNTU USERS, FOLLOW README! nvidia_pkg=( - libva-wayland2 - libnvidia-egl-wayland1 - nvidia-vaapi-driver + libva-wayland2 + libnvidia-egl-wayland1 + nvidia-vaapi-driver ) # for ubuntu-nvidia owners! just delete # @@ -53,52 +53,51 @@ add_to_file() { # Install additional Nvidia packages printf "${YELLOW} Installing Nvidia packages...\n" - for NVIDIA in "${nvidia_pkg[@]}"; do +for NVIDIA in "${nvidia_pkg[@]}"; do install_package "$NVIDIA" 2>&1 | tee -a "$LOG" - done +done +printf "${YELLOW} nvidia-stuff to /etc/default/grub...\n" -printf "${YELLOW} nvidia-stuff to /etc/default/grub..." +# Additional options to add to GRUB_CMDLINE_LINUX +additional_options="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rcutree.rcu_idle_gp_delay=1" - # Additional options to add to GRUB_CMDLINE_LINUX - additional_options="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rcutree.rcu_idle_gp_delay=1" - - # Check if additional options are already present in GRUB_CMDLINE_LINUX - if grep -q "GRUB_CMDLINE_LINUX.*$additional_options" /etc/default/grub; then +# Check if additional options are already present in GRUB_CMDLINE_LINUX +if grep -q "GRUB_CMDLINE_LINUX.*$additional_options" /etc/default/grub; then echo "GRUB_CMDLINE_LINUX already contains the additional options" - else +else # Append the additional options to GRUB_CMDLINE_LINUX sudo sed -i "s/GRUB_CMDLINE_LINUX=\"/GRUB_CMDLINE_LINUX=\"$additional_options /" /etc/default/grub echo "Added the additional options to GRUB_CMDLINE_LINUX" - fi +fi - # Update GRUB configuration - sudo update-grub 2>&1 | tee -a "$LOG" - - # Define the configuration file and the line to add - config_file="/etc/modprobe.d/nvidia.conf" - line_to_add=""" - options nvidia-drm modeset=1 fbdev=1 - options nvidia NVreg_PreserveVideoMemoryAllocations=1 - """ +# Update GRUB configuration +sudo update-grub 2>&1 | tee -a "$LOG" - # Check if the config file exists - if [ ! -e "$config_file" ]; then - echo "Creating $config_file" - sudo touch "$config_file" 2>&1 | tee -a "$LOG" - fi +# Define the configuration file and the line to add +config_file="/etc/modprobe.d/nvidia.conf" +line_to_add=""" +options nvidia-drm modeset=1 fbdev=1 +options nvidia NVreg_PreserveVideoMemoryAllocations=1 +""" - add_to_file "$config_file" "$line_to_add" +# Check if the config file exists +if [ ! -e "$config_file" ]; then + echo "Creating $config_file" + sudo touch "$config_file" 2>&1 | tee -a "$LOG" +fi - # Add NVIDIA modules to initramfs configuration - modules_to_add="nvidia nvidia_modeset nvidia_uvm nvidia_drm" - modules_file="/etc/initramfs-tools/modules" +add_to_file "$config_file" "$line_to_add" - if [ -e "$modules_file" ]; then +# Add NVIDIA modules to initramfs configuration +modules_to_add="nvidia nvidia_modeset nvidia_uvm nvidia_drm" +modules_file="/etc/initramfs-tools/modules" + +if [ -e "$modules_file" ]; then add_to_file "$modules_file" "$modules_to_add" 2>&1 | tee -a "$LOG" sudo update-initramfs -u 2>&1 | tee -a "$LOG" - else +else echo "Modules file ($modules_file) not found." 2>&1 | tee -a "$LOG" - fi +fi clear diff --git a/install-scripts/nwg-look.sh b/install-scripts/nwg-look.sh index 00d3cdf..164717a 100755 --- a/install-scripts/nwg-look.sh +++ b/install-scripts/nwg-look.sh @@ -1,12 +1,12 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# nwg-look ) # +# nwg-look # nwg_look=( - golang - libgtk-3-dev - libcairo2-dev - libglib2.0-bin + golang + libgtk-3-dev + libcairo2-dev + libglib2.0-bin ) # specific tags to download @@ -28,11 +28,11 @@ MLOG="install-$(date +'%d-%H%M%S')_nwg-look2.log" # 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 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done printf "${NOTE} Installing nwg-look\n" diff --git a/install-scripts/rofi-wayland.sh b/install-scripts/rofi-wayland.sh index d50a8b6..51c5825 100755 --- a/install-scripts/rofi-wayland.sh +++ b/install-scripts/rofi-wayland.sh @@ -1,17 +1,17 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# Rofi-Wayland) # +# Rofi-Wayland # rofi=( - bison - flex - pandoc - doxygen - cppcheck - ohcount - libmpdclient-dev - libnl-3-dev - libasound2-dev + bison + flex + pandoc + doxygen + cppcheck + ohcount + libmpdclient-dev + libnl-3-dev + libasound2-dev ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -28,13 +28,13 @@ source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" 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 +# Uninstall other rofi 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} - $PKG uninstallation had failed, please check the log" - exit 1 - fi + uninstall_package "$PKG" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG uninstallation had failed, please check the log" + exit 1 + fi done sleep 1 @@ -43,40 +43,40 @@ printf "\n" 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 Package installation failed, Please check the installation logs"; exit 1; } - done +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 Package installation failed, Please check the installation logs"; exit 1; } +done printf "\n\n" -# Clone and build rofi - wayland +# Clone and build rofi-wayland printf "${NOTE} Installing rofi-wayland...\n" # Check if rofi folder exists if [ -d "rofi" ]; then - printf "${NOTE} rofi folder exists. Removing existing directory...\n" - rm -rf rofi + printf "${NOTE} rofi folder exists. Removing existing directory...\n" + rm -rf rofi fi -# cloning rofi-wayland +# Cloning rofi-wayland printf "${NOTE} Cloning rofi-wayland repository...\n" if git clone https://github.com/lbonn/rofi.git; then - cd rofi || exit 1 + cd rofi || exit 1 else - echo -e "${ERROR} Download failed for rofi-wayland." 2>&1 | tee -a "$LOG" - exit 1 + echo -e "${ERROR} Download failed for rofi-wayland." 2>&1 | tee -a "$LOG" + exit 1 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} Installation failed for rofi-wayland." 2>&1 | tee -a "$MLOG" - fi +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} Installation failed for rofi-wayland." 2>&1 | tee -a "$MLOG" + fi else - echo -e "${ERROR} Meson setup or ninja build failed for rofi-wayland." 2>&1 | tee -a "$MLOG" + echo -e "${ERROR} Meson setup or ninja build failed for rofi-wayland." 2>&1 | tee -a "$MLOG" fi # Move logs to Install-Logs directory diff --git a/install-scripts/rog.sh b/install-scripts/rog.sh index 619c0c8..822a5cc 100755 --- a/install-scripts/rog.sh +++ b/install-scripts/rog.sh @@ -1,9 +1,9 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# ASUS ROG ) # +# ASUS ROG # asus=( - power-profiles-daemon + power-profiles-daemon ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -22,13 +22,13 @@ source $HOME/.cargo/env # Set the name of the log file to include the current date and time LOG="install-$(date +%d-%H%M%S)_rog.log" -# Installing enhancemet +# Installing enhancement for PKG1 in "${asus[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done printf " enabling power-profiles-daemon...\n" @@ -36,32 +36,32 @@ sudo systemctl enable power-profiles-daemon 2>&1 | tee -a "$LOG" # Function to handle the installation and log messages install_and_log() { - local project_name="$1" - local git_url="$2" - - printf "${NOTE} Installing $project_name\n" + local project_name="$1" + local git_url="$2" + + printf "${NOTE} Installing $project_name\n" - if git clone "$git_url" "$project_name"; then - cd "$project_name" || exit 1 + if git clone "$git_url" "$project_name"; then + cd "$project_name" || exit 1 - make + make - if sudo make install 2>&1 | tee -a "$LOG"; then - printf "${OK} $project_name installed successfully.\n" - if [ "$project_name" == "supergfxctl" ]; then - # Enable supergfxctl - sudo systemctl enable --now supergfxd 2>&1 | tee -a "$LOG" - fi + if sudo make install 2>&1 | tee -a "$LOG"; then + printf "${OK} $project_name installed successfully.\n" + if [ "$project_name" == "supergfxctl" ]; then + # Enable supergfxctl + sudo systemctl enable --now supergfxd 2>&1 | tee -a "$LOG" + fi + else + echo -e "${ERROR} Installation failed for $project_name." + fi + + # Moving logs into main install-logs + mv "$LOG" ../Install-Logs/ || true + cd - || exit 1 else - echo -e "${ERROR} Installation failed for $project_name." + echo -e "${ERROR} Cloning $project_name from $git_url failed." fi - - #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." - fi } # Download and build asusctl diff --git a/install-scripts/sddm.sh b/install-scripts/sddm.sh index b7da9ed..97f3067 100755 --- a/install-scripts/sddm.sh +++ b/install-scripts/sddm.sh @@ -4,15 +4,15 @@ # installing with NO-recommends sddm1=( - sddm + sddm ) sddm2=( - qml-module-qtgraphicaleffects - qml-module-qtquick-controls - qml-module-qtquick-controls2 - qml-module-qtquick-extras - qml-module-qtquick-layouts + qml-module-qtgraphicaleffects + qml-module-qtquick-controls + qml-module-qtquick-controls2 + qml-module-qtquick-extras + qml-module-qtquick-layouts ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -28,33 +28,32 @@ source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm.log" - # 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 - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + sudo apt-get install --no-install-recommends -y "$PKG1" 2>&1 + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done # Installation of additional sddm stuff printf "\n%s - Installing sddm additional stuff.... \n" "${NOTE}" for PKG2 in "${sddm2[@]}"; do - install_package "$PKG2" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG2 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG2" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG2 Package installation failed, Please check the installation logs" + exit 1 + fi done # Check if other login managers are installed and disabling their service before enabling sddm for login_manager in lightdm gdm lxdm lxdm-gtk3; do - if sudo apt-get list installed "$login_manager" &>> /dev/null; then - echo "Disabling $login_manager..." - sudo systemctl disable "$login_manager" 2>&1 | tee -a "$LOG" - fi + if sudo apt-get list installed "$login_manager" &>> /dev/null; then + echo "Disabling $login_manager..." + sudo systemctl disable "$login_manager" 2>&1 | tee -a "$LOG" + fi done printf " Activating sddm service........\n" @@ -68,49 +67,49 @@ sddm_conf_dir=/etc/sddm.conf.d wayland_sessions_dir=/usr/share/wayland-sessions [ ! -d "$wayland_sessions_dir" ] && { printf "$CAT - $wayland_sessions_dir not found, creating...\n"; sudo mkdir -p "$wayland_sessions_dir" 2>&1 | tee -a "$LOG"; } sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG" - + # SDDM-themes valid_input=false while [ "$valid_input" != true ]; do - read -n 1 -r -p "${CAT} OPTIONAL - Would you like to install SDDM themes? (y/n)" install_sddm_theme - if [[ $install_sddm_theme =~ ^[Yy]$ ]]; then - printf "\n%s - Installing Simple SDDM Theme\n" "${NOTE}" + read -n 1 -r -p "${CAT} OPTIONAL - Would you like to install SDDM themes? (y/n)" install_sddm_theme + if [[ $install_sddm_theme =~ ^[Yy]$ ]]; then + printf "\n%s - Installing Simple SDDM Theme\n" "${NOTE}" - # Check if /usr/share/sddm/themes/simple-sddm exists and remove if it does - if [ -d "/usr/share/sddm/themes/simple-sddm" ]; then - sudo rm -rf "/usr/share/sddm/themes/simple-sddm" - echo -e "\e[1A\e[K${OK} - Removed existing 'simple-sddm' directory." 2>&1 | tee -a "$LOG" + # Check if /usr/share/sddm/themes/simple-sddm exists and remove if it does + if [ -d "/usr/share/sddm/themes/simple-sddm" ]; then + sudo rm -rf "/usr/share/sddm/themes/simple-sddm" + echo -e "\e[1A\e[K${OK} - Removed existing 'simple-sddm' directory." 2>&1 | tee -a "$LOG" + fi + + # Check if simple-sddm directory exists in the current directory and remove if it does + if [ -d "simple-sddm" ]; then + rm -rf "simple-sddm" + 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; then + while [ ! -d "simple-sddm" ]; do + sleep 1 + done + + if [ ! -d "/usr/share/sddm/themes" ]; then + sudo mkdir -p /usr/share/sddm/themes + echo -e "\e[1A\e[K${OK} - Directory '/usr/share/sddm/themes' created." 2>&1 | tee -a "$LOG" + fi + + sudo mv simple-sddm /usr/share/sddm/themes/ + echo -e "[Theme]\nCurrent=simple-sddm" | sudo tee "$sddm_conf_dir/theme.conf.user" &>> "$LOG" + else + echo -e "\e[1A\e[K${ERROR} - Failed to clone the theme repository. Please check your internet connection or repository availability." | tee -a "$LOG" >&2 + fi + valid_input=true + elif [[ $install_sddm_theme =~ ^[Nn]$ ]]; then + printf "\n%s - No SDDM themes will be installed.\n" "${NOTE}" 2>&1 | tee -a "$LOG" + valid_input=true + else + printf "\n%s - Invalid input. Please enter 'y' for Yes or 'n' for No.\n" "${ERROR}" 2>&1 | tee -a "$LOG" + install_sddm_theme="" fi - - # Check if simple-sddm directory exists in the current directory and remove if it does - if [ -d "simple-sddm" ]; then - rm -rf "simple-sddm" - 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; then - while [ ! -d "simple-sddm" ]; do - sleep 1 - done - - if [ ! -d "/usr/share/sddm/themes" ]; then - sudo mkdir -p /usr/share/sddm/themes - echo -e "\e[1A\e[K${OK} - Directory '/usr/share/sddm/themes' created." 2>&1 | tee -a "$LOG" - fi - - sudo mv simple-sddm /usr/share/sddm/themes/ - echo -e "[Theme]\nCurrent=simple-sddm" | sudo tee "$sddm_conf_dir/theme.conf.user" &>> "$LOG" - else - echo -e "\e[1A\e[K${ERROR} - Failed to clone the theme repository. Please check your internet connection or repository availability." | tee -a "$LOG" >&2 - fi - valid_input=true - elif [[ $install_sddm_theme =~ ^[Nn]$ ]]; then - printf "\n%s - No SDDM themes will be installed.\n" "${NOTE}" 2>&1 | tee -a "$LOG" - valid_input=true - else - printf "\n%s - Invalid input. Please enter 'y' for Yes or 'n' for No.\n" "${ERROR}" 2>&1 | tee -a "$LOG" - install_sddm_theme="" - fi -done +done clear diff --git a/install-scripts/swappy.sh b/install-scripts/swappy.sh index 2b8665b..665fc00 100755 --- a/install-scripts/swappy.sh +++ b/install-scripts/swappy.sh @@ -3,9 +3,9 @@ # swappy - for screenshot) # swappy=( -liblocale-msgfmt-perl -gettext -libgtk-3-dev + liblocale-msgfmt-perl + gettext + libgtk-3-dev ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -25,20 +25,20 @@ MLOG="install-$(date +%d-%H%M%S)_swappy.log" printf "${NOTE} Installing swappy..\n" for PKG1 in "${swappy[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done # Force reinstall above as seems its giving issue as swappy cant be build for PKG1 in "${swappy[@]}"; do - sudo apt-get --reinstall install "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package re-installation failed, Please check the installation logs" - exit 1 - fi + sudo apt-get --reinstall install "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package re-installation failed, Please check the installation logs" + exit 1 + fi done printf "${NOTE} Installing swappy from source...\n" @@ -53,15 +53,15 @@ fi printf "${NOTE} Installing swappy...\n" if git clone --depth 1 https://github.com/jtheoof/swappy.git; then cd swappy || exit 1 - meson setup build - ninja -C build - if sudo ninja -C build install 2>&1 | tee -a "$MLOG" ; then + meson setup build + ninja -C build + if sudo ninja -C build install 2>&1 | tee -a "$MLOG"; then printf "${OK} swappy installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for swappy." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for swappy." 2>&1 | tee -a "$LOG" diff --git a/install-scripts/swww.sh b/install-scripts/swww.sh index 4321fef..33c97a8 100755 --- a/install-scripts/swww.sh +++ b/install-scripts/swww.sh @@ -3,10 +3,10 @@ # SWWW - Wallpaper Utility # swww=( -liblz4-dev + liblz4-dev ) -#specific branch or release +# specific branch or release swww_tag="v0.9.5" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -27,18 +27,18 @@ MLOG="install-$(date +%d-%H%M%S)_swww.log" printf "\n%s - Installing swww dependencies.... \n" "${NOTE}" for PKG1 in "${swww[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done printf "${NOTE} Force installing packages...\n" - for FORCE in "${swww[@]}"; do - sudo apt-get --reinstall install -y "$FORCE" 2>&1 | tee -a "$LOG" - [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $FORCE Package installation failed, Please check the installation logs"; exit 1; } - done +for FORCE in "${swww[@]}"; do + sudo apt-get --reinstall install -y "$FORCE" 2>&1 | tee -a "$LOG" + [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $FORCE Package installation failed, Please check the installation logs"; exit 1; } +done printf "\n\n" @@ -46,17 +46,17 @@ printf "${NOTE} Installing swww\n" # Check if swww folder exists if [ -d "swww" ]; then - printf "${NOTE} swww folder exists. Pulling latest changes...\n" - cd swww || exit 1 - git pull origin main 2>&1 | tee -a "$MLOG" -else - printf "${NOTE} Cloning swww repository...\n" - if git clone --recursive https://github.com/Horus645/swww.git; then + printf "${NOTE} swww folder exists. Pulling latest changes...\n" cd swww || exit 1 - else - echo -e "${ERROR} Download failed for swww" 2>&1 | tee -a "$LOG" - exit 1 - fi + git pull origin main 2>&1 | tee -a "$MLOG" +else + printf "${NOTE} Cloning swww repository...\n" + if git clone --recursive 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 diff --git a/install-scripts/thunar.sh b/install-scripts/thunar.sh index 08cfc82..9640420 100755 --- a/install-scripts/thunar.sh +++ b/install-scripts/thunar.sh @@ -3,13 +3,13 @@ # Thunar # thunar=( -ffmpegthumbnailer -file-roller -thunar -thunar-volman -tumbler -thunar-archive-plugin -xarchiver + ffmpegthumbnailer + file-roller + thunar + thunar-volman + tumbler + thunar-archive-plugin + xarchiver ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -25,21 +25,21 @@ source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_thunar.log" -printf "${NOTE} Installing Thunar Packages...\n" - for THUNAR in "${thunar[@]}"; do +printf "${NOTE} Installing Thunar Packages...\n" +for THUNAR in "${thunar[@]}"; do install_package "$THUNAR" 2>&1 | tee -a "$LOG" [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $THUNAR Package installation failed, Please check the installation logs"; exit 1; } - done +done - # Check for existing configs and copy if does not exist +# Check for existing configs and copy if does not exist for DIR1 in gtk-3.0 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 + 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/wallust.sh b/install-scripts/wallust.sh index 59925df..45250cd 100755 --- a/install-scripts/wallust.sh +++ b/install-scripts/wallust.sh @@ -1,12 +1,12 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# wallust - pywal colors replacment # +# wallust - pywal colors replacement # depend=( -librust-jpeg-decoder-dev + librust-jpeg-decoder-dev ) -#specific branch or release +# specific branch or release wal_tag="dev" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -23,17 +23,16 @@ source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" LOG="Install-Logs/install-$(date +%d-%H%M%S)_wallust.log" MLOG="install-$(date +%d-%H%M%S)_wallust.log" -# Installing depencies +# Installing dependencies for PKG1 in "${depend[@]}"; do - install_package "$PKG1" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" - exit 1 - fi + install_package "$PKG1" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" + exit 1 + fi done -## -printf "${NOTE} Installing wallust from dev branch...\n" +printf "${NOTE} Installing wallust from dev branch...\n" # Check if folder exists and remove it if [ -d "wallust" ]; then @@ -43,20 +42,19 @@ fi # Clone and build wallust printf "${NOTE} Installing wallust...\n" -if git clone --depth 1 -b $wal_tag https://codeberg.org/explosion-mental/wallust.git; then +if git clone --depth 1 -b "$wal_tag" https://codeberg.org/explosion-mental/wallust.git; then cd wallust || exit 1 - make - if sudo make install 2>&1 | tee -a "$MLOG" ; then + make + if sudo make install 2>&1 | tee -a "$MLOG"; then printf "${OK} wallust installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for wallust." 2>&1 | tee -a "$MLOG" fi - #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for wallust." 2>&1 | tee -a "$LOG" fi clear - diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh index 54ae298..c8803e1 100755 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -3,7 +3,7 @@ # XDG-Desktop-Portals # xdg=( -xdg-desktop-portal-gtk + xdg-desktop-portal-gtk ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -21,10 +21,13 @@ 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" +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 Package installation failed, Please check the installation logs"; exit 1; } + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $portal Package installation failed, Please check the installation logs" + exit 1 + fi done # Check if xdg-desktop-portal-hyprland folder exists and remove it @@ -38,13 +41,13 @@ printf "${NOTE} Installing xdg-desktop-portal-hyprland...\n" if git clone --branch v1.3.0 --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 + 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 + # Moving the additional logs to Install-Logs directory + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for xdg-desktop-portal-hyprland." 2>&1 | tee -a "$LOG" @@ -61,31 +64,29 @@ while true; do sleep 1 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." - ;; + [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 - diff --git a/install-scripts/zsh.sh b/install-scripts/zsh.sh index c0b73ad..575a3b1 100755 --- a/install-scripts/zsh.sh +++ b/install-scripts/zsh.sh @@ -3,8 +3,8 @@ # Zsh and Oh my Zsh + Optional Pokemon ColorScripts# zsh=( -zsh -zplug + zsh + zplug ) ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## @@ -23,17 +23,17 @@ 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++)) + 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 ZSHP in "${zsh[@]}"; do - install_package "$ZSHP" 2>&1 | tee -a "$LOG" - if [ $? -ne 0 ]; then - echo -e "\e[1A\e[K${ERROR} - $ZSHP Package installation failed, Please check the installation logs" - fi + install_package "$ZSHP" 2>&1 | tee -a "$LOG" + if [ $? -ne 0 ]; then + echo -e "\e[1A\e[K${ERROR} - $ZSHP Package installation failed, Please check the installation logs" + fi done printf "\n" @@ -50,7 +50,7 @@ while true; do 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" + echo "${NOTE} Pokemon Installation process completed" 2>&1 | tee -a "$LOG" break ;; [Nn]*) @@ -67,45 +67,45 @@ 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." 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 - 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." 2>&1 | tee -a "$LOG" - fi + 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." 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 + 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." 2>&1 | tee -a "$LOG" + fi - 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." 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 [ ! -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." 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 + if [ -f "$HOME/.zprofile" ]; then + cp -b "$HOME/.zprofile" "$HOME/.zprofile-backup" || true + fi cp -r 'assets/.zshrc' ~/ cp -r 'assets/.zprofile' ~/ 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 - done - printf "\n" - printf "${NOTE} Shell changed successfully to zsh.\n" 2>&1 | tee -a "$LOG" + while ! chsh -s $(which zsh); do + 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 diff --git a/install.sh b/install.sh index 913f651..7b21b83 100755 --- a/install.sh +++ b/install.sh @@ -10,10 +10,10 @@ fi clear -printf "\n%.0s" {1..3} +printf "\n%.0s" {1..3} echo " | _. |/ _ _ | o _|_ " echo " \_| (_| o |\ (_) (_) |_ | |_ " -printf "\n%.0s" {1..2} +printf "\n%.0s" {1..2} # Welcome message echo "$(tput setaf 6)Welcome to JaKooLit's Ubuntu 24.04 Hyprland Install Script!$(tput sgr0)" @@ -26,7 +26,7 @@ echo "$(tput setaf 3)NOTE: If you are installing on a VM, ensure to enable 3D ac echo printf "\n%.0s" {1..4} -echo "$(tput bold)$(tput setaf 3)ATTENTION!!!! VERY IMPORTANT NOTICE!!!! $(tput sgr0)" +echo "$(tput bold)$(tput setaf 3)ATTENTION!!!! VERY IMPORTANT NOTICE!!!! $(tput sgr0)" echo "$(tput bold)$(tput setaf 7)Latest Hyprland compatible with Ubuntu 24.04 is only up to v0.39.1 $(tput sgr0)" echo "$(tput bold)$(tput setaf 7)This was due to old version is wayland-protocols available in Ubuntu Repo $(tput sgr0)" echo "$(tput bold)$(tput setaf 7)Because of the above, the latest Hyprland-Dots compatible will only be v2.2.13 $(tput sgr0)" @@ -113,6 +113,7 @@ ask_custom_option() { fi done } + # Function to execute a script if it exists and make it executable execute_script() { local script="$1" @@ -174,8 +175,7 @@ execute_script "hypridle.sh" execute_script "hyprland.sh" execute_script "hypr-eco.sh" - -#execute_script "cliphist.sh" +# execute_script "cliphist.sh" if [ "$nvidia" == "Y" ]; then execute_script "nvidia.sh" @@ -212,6 +212,7 @@ fi if [ "$rog" == "Y" ]; then execute_script "rog.sh" fi + # re-install rofi-wayland execute_script "rofi-wayland.sh" execute_script "InputGroup.sh" @@ -245,5 +246,5 @@ if [[ "$HYP" =~ ^[Yy]$ ]]; then systemctl reboot else systemctl reboot - fi -fi + fi +fi \ No newline at end of file