Merge pull request #154 from JaKooLit/main

Main to development
This commit is contained in:
Ja.KooLit 2024-09-05 17:09:18 +09:00 committed by GitHub
commit a15ea4ab9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 84 additions and 74 deletions

View File

@ -1,5 +1,8 @@
## Changelogs ## Changelogs
## 04 Sep 2024
- added a function to check if it is Ubuntu or Based on Ubuntu and script will exit
## 28 Aug 2024 ## 28 Aug 2024
- Added final check if hyprland is installed and will give an error to user - Added final check if hyprland is installed and will give an error to user

View File

@ -1,6 +1,6 @@
## NOTE: Ubuntu-Hyprland install script are moved to a different Repo ## NOTE: Ubuntu-Hyprland install script has its own repo now
- [`Ubuntu-Hyprland LINK`](https://github.com/JaKooLit/Ubuntu-Hyprland) - [`Ubuntu-Hyprland LINK`](https://github.com/JaKooLit/Ubuntu-Hyprland)
- Ubuntu-Hyprland install script on this repo/branch will be deleted by the End Aug 2024
<div align="center"> <div align="center">
<br> <br>

View File

@ -3,7 +3,6 @@
# SWWW - Wallpaper Utility # # SWWW - Wallpaper Utility #
swww=( swww=(
cargo
liblz4-dev liblz4-dev
) )
@ -35,6 +34,14 @@ for PKG1 in "${swww[@]}"; do
fi fi
done 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
printf "\n\n"
printf "${NOTE} Installing swww\n" printf "${NOTE} Installing swww\n"
# Check if swww folder exists # Check if swww folder exists
@ -44,7 +51,7 @@ if [ -d "swww" ]; then
git pull origin main 2>&1 | tee -a "$MLOG" git pull origin main 2>&1 | tee -a "$MLOG"
else else
printf "${NOTE} Cloning swww repository...\n" printf "${NOTE} Cloning swww repository...\n"
if git clone --recursive -b $swww_tag https://github.com/Horus645/swww.git; then if git clone --recursive https://github.com/Horus645/swww.git; then
cd swww || exit 1 cd swww || exit 1
else else
echo -e "${ERROR} Download failed for swww" 2>&1 | tee -a "$LOG" echo -e "${ERROR} Download failed for swww" 2>&1 | tee -a "$LOG"
@ -52,14 +59,6 @@ else
fi fi
fi fi
# install new rust
# Define environment variables for non-interactive installation
export RUSTUP_INIT_SKIP_PATH_CHECK=yes
export RUSTUP_INIT_SKIP_CONFIRMATION=yes
# Download and execute the Rust installer script, automatically answering "yes" to all prompts
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path 2>&1 | tee -a "$LOG" || true
# Proceed with the rest of the installation steps # Proceed with the rest of the installation steps
source "$HOME/.cargo/env" || true source "$HOME/.cargo/env" || true

View File

@ -1,14 +1,7 @@
#!/bin/bash #!/bin/bash
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# wallust - pywal colors replacment # # wallust - pywal colors replacement #
depend=(
librust-jpeg-decoder-dev
rust
)
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
# Determine the directory where the script is located # Determine the directory where the script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -16,46 +9,41 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || exit 1 cd "$PARENT_DIR" || exit 1
# Source external functions, adjust path as necessary
source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_wallust.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_wallust.log"
MLOG="install-$(date +%d-%H%M%S)_wallust2.log"
# Installing depencies # Create log directory if it doesn't exist
for PKG1 in "${depend[@]}"; do mkdir -p "$(dirname "$LOG")"
install_package "$PKG1" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then # Install up-to-date Rust
echo -e "\033[1A\033[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" echo "Installing most up to Rust compiler..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 2>&1 | tee -a "$LOG"
source "$HOME/.cargo/env"
printf "\n%.0s" {1..2}
# Remove any existing Wallust binary
if [[ -f "/usr/local/bin/wallust" ]]; then
echo "Removing existing Wallust binary..." 2>&1 | tee -a "$LOG"
sudo rm "/usr/local/bin/wallust"
fi
printf "\n%.0s" {1..2}
# Install Wallust using Cargo
echo "Installing Wallust using Cargo..." | tee -a "$LOG"
if cargo install wallust 2>&1 | tee -a "$LOG" ; then
echo "Wallust installed successfully." | tee -a "$LOG"
# Move the newly compiled binary to /usr/local/bin
echo "Moving Wallust binary to /usr/local/bin..." | tee -a "$LOG"
sudo mv "$HOME/.cargo/bin/wallust" /usr/local/bin 2>&1 | tee -a "$LOG"
else
echo "Error: Wallust installation failed. Check the log file $LOG for details." | tee -a "$LOG"
exit 1 exit 1
fi fi
done
##
printf "${NOTE} Installing wallust from dev branch...\n"
# Check if folder exists and remove it
if [ -d "wallust" ]; then
printf "${NOTE} Removing existing wallust folder...\n"
rm -rf "wallust"
fi
# Clone and build wallust
printf "${NOTE} Installing wallust...\n"
if git clone --depth 1 https://codeberg.org/explosion-mental/wallust.git; then
cd wallust || exit 1
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
cd ..
else
echo -e "${ERROR} Download failed for wallust." 2>&1 | tee -a "$LOG"
fi
clear clear

View File

@ -10,6 +10,24 @@ fi
clear clear
# Function to check if the system is Ubuntu
is_ubuntu() {
# Check for 'Ubuntu' in /etc/os-release
if grep -q 'Ubuntu' /etc/os-release; then
return 0
fi
return 1
}
# Check if the system is Ubuntu
if is_ubuntu; then
echo "This script is NOT intended for Ubuntu / Ubuntu Based. Please read the README for the correct link."
exit 1
fi
clear
# ASCII art
printf "\n%.0s" {1..3} printf "\n%.0s" {1..3}
echo " | _. |/ _ _ | o _|_ " echo " | _. |/ _ _ | o _|_ "
echo " \_| (_| o |\ (_) (_) |_ | |_ " echo " \_| (_| o |\ (_) (_) |_ | |_ "
@ -18,20 +36,22 @@ printf "\n%.0s" {1..2}
# Welcome message # Welcome message
echo "$(tput setaf 6)Welcome to JaKooLit's Debian Trixie/SID Hyprland Install Script!$(tput sgr0)" echo "$(tput setaf 6)Welcome to JaKooLit's Debian Trixie/SID Hyprland Install Script!$(tput sgr0)"
echo echo
echo "$(tput setaf 166)ATTENTION: Run a full system update and Reboot first!! (Highly Recommended) $(tput sgr0)" echo "$(tput setaf 166)ATTENTION: Run a full system update and reboot first!! (Highly Recommended)$(tput sgr0)"
echo echo
echo "$(tput setaf 3)NOTE: You will be required to answer some questions during the installation!$(tput sgr0)" echo "$(tput setaf 3)NOTE: You will be required to answer some questions during the installation!$(tput sgr0)"
echo echo
echo "$(tput setaf 3)NOTE: If you are installing on a VM, ensure to enable 3D acceleration else Hyprland wont start! $(tput sgr0)" echo "$(tput setaf 3)NOTE: If you are installing on a VM, ensure to enable 3D acceleration; otherwise, Hyprland won't start!$(tput sgr0)"
echo echo
# Prompt user to proceed
read -p "$(tput setaf 6)Would you like to proceed? (y/n): $(tput sgr0)" proceed read -p "$(tput setaf 6)Would you like to proceed? (y/n): $(tput sgr0)" proceed
if [ "$proceed" != "y" ]; then if [[ "$proceed" != "y" ]]; then
echo "Installation aborted." echo "Installation aborted."
exit 1 exit 1
fi fi
read -p "$(tput setaf 6)Have you edited your /etc/apt/sources.list? [Very Important] (y/n): $(tput sgr0)" proceed2 read -p "$(tput setaf 6)Have you edited your /etc/apt/sources.list? [Very Important] (y/n): $(tput sgr0)" proceed2
if [ "$proceed2" != "y" ]; then if [ "$proceed2" != "y" ]; then
@ -161,10 +181,10 @@ execute_script "01-pre-cleanup.sh"
execute_script "00-dependencies.sh" execute_script "00-dependencies.sh"
execute_script "00-hypr-pkgs.sh" execute_script "00-hypr-pkgs.sh"
execute_script "fonts.sh" execute_script "fonts.sh"
execute_script "wallust.sh"
execute_script "imagemagick.sh" execute_script "imagemagick.sh"
execute_script "swww.sh" execute_script "swww.sh"
execute_script "rofi-wayland.sh" execute_script "rofi-wayland.sh"
execute_script "wallust.sh"
execute_script "ags.sh" execute_script "ags.sh"
execute_script "hyprland.sh" execute_script "hyprland.sh"
execute_script "hyprlock.sh" execute_script "hyprlock.sh"
@ -245,7 +265,7 @@ if dpkg -l | grep -qw hyprland || dpkg -l | grep -qw hyprland-git; then
fi fi
else else
# Print error message if neither package is installed # Print error message if neither package is installed
printf "\n${NOTE} Hyprland failed to install. Please check Install-Logs...\n\n" printf "\n${WARN} Hyprland failed to install. Please check Install-Logs...\n\n"
exit 1 exit 1
fi fi