- adding hypridle and hyprlock

- dropping swaylock-effects and swayidle
- adjusted to work with recent Hyprland-Dots
This commit is contained in:
JaKooLit 2024-04-30 11:09:07 +09:00
parent dcfabb19e9
commit 5cd440d19c
8 changed files with 186 additions and 84 deletions

View File

@ -2,6 +2,9 @@
## 30 Apr 2024 ## 30 Apr 2024
- Updated hyprland.sh to install v0.34.0 Hyprland - Updated hyprland.sh to install v0.34.0 Hyprland
- adding hypridle and hyprlock
- dropping swaylock-effects and swayidle
- adjusted to work with current Hyprland-Dots
## 22 Apr 2024 ## 22 Apr 2024
- Change dotfiles to specific version only as Debian and Ubuntu cant keep up with Hyprland development - Change dotfiles to specific version only as Debian and Ubuntu cant keep up with Hyprland development

View File

@ -11,11 +11,6 @@
### ♨️♨️♨️ ATTENTION ♨️♨️♨️ 30 Apr 2024 ### ♨️♨️♨️ ATTENTION ♨️♨️♨️ 30 Apr 2024
- Due to fast development of Hyprland and most up to date requirement of hyprland, Hyprland version to be installed by this script will be older version. For now, the hyprland version to be installed with this script is v0.34.0 - Due to fast development of Hyprland and most up to date requirement of hyprland, Hyprland version to be installed by this script will be older version. For now, the hyprland version to be installed with this script is v0.34.0
### ♨️♨️♨️ ATTENTION ♨️♨️♨️ 22 Apr 2024
- Pre-configured dotfiles to be downloaded here will be v2.2.6 only
- [`Hyprland-Dots v2.2.6`](https://github.com/JaKooLit/Hyprland-Dots/releases/tag/v2.2.6)
- This is because Debian/Ubuntu are very slow with Hyprland Development
> [!IMPORTANT] > [!IMPORTANT]
> install a backup tool like `snapper` or `timeshift`. and Backup your system before installing hyprland using this script. This script does NOT include uninstallation of packages > install a backup tool like `snapper` or `timeshift`. and Backup your system before installing hyprland using this script. This script does NOT include uninstallation of packages

View File

@ -51,7 +51,6 @@ hypr_package_2=(
mpv-mpris mpv-mpris
nvtop nvtop
pamixer pamixer
swayidle
vim vim
) )

View File

@ -1,51 +1,86 @@
#!/bin/bash #!/bin/bash
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# Hyprland-Dots to download a specific release # # Hyprland-Dots to download from Releases #
if [[ $USE_PRESET = [Yy] ]]; then
# Define the specific release version to download source ./preset.sh
specific_version="v2.2.6" fi
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"
printf "${NOTE} Downloading / Checking for existing Hyprland-Dots-${specific_version}.tar.gz...\n" printf "${NOTE} Downloading / Checking for existing Hyprland-Dots.tar.gz...\n"
# Check if the specific release tarball exists # Check if Hyprland-Dots.tar.gz exists
if [ -f "Hyprland-Dots-${specific_version}.tar.gz" ]; then if [ -f Hyprland-Dots.tar.gz ]; then
printf "${NOTE} Hyprland-Dots-${specific_version}.tar.gz found.\n" printf "${NOTE} Hyprland-Dots.tar.gz found.\n"
echo -e "${OK} Hyprland-Dots-${specific_version}.tar.gz is already downloaded."
# Get the version from the existing tarball filename
existing_version=$(echo Hyprland-Dots.tar.gz | grep -oP 'v\d+\.\d+\.\d+' | sed 's/v//')
# Fetch the tag_name for the latest release using the GitHub API
latest_version=$(curl -s https://api.github.com/repos/JaKooLit/Hyprland-Dots/releases/latest | grep "tag_name" | cut -d '"' -f 4 | sed 's/v//')
# Check if versions match
if [ "$existing_version" = "$latest_version" ]; then
echo -e "${OK} Hyprland-Dots.tar.gz is up-to-date with the latest release ($latest_version)."
# Sleep for 10 seconds before exiting
printf "${NOTE} No update found. Sleeping for 10 seconds...\n"
sleep 10
exit 0 exit 0
else
echo -e "${WARN} Hyprland-Dots.tar.gz is outdated (Existing version: $existing_version, Latest version: $latest_version)."
if [[ -z $upgrade_choice ]]; then
read -p "Do you want to upgrade to the latest version? (y/n): " upgrade_choice
fi
if [ "$upgrade_choice" = "y" ]; then
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..." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log"
exit 0
fi
fi
fi fi
printf "${NOTE} Downloading the Hyprland-Dots-${specific_version} source code release...\n" printf "${NOTE} Downloading the latest Hyprland source code release...\n"
# Fetch the tag name for the specific release using the GitHub API # Fetch the tag name for the latest release using the GitHub API
release_info=$(curl -s "https://api.github.com/repos/JaKooLit/Hyprland-Dots/releases/tags/${specific_version}") latest_tag=$(curl -s https://api.github.com/repos/JaKooLit/Hyprland-Dots/releases/latest | grep "tag_name" | cut -d '"' -f 4)
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" # Check if the tag is obtained successfully
if [ -z "$latest_tag" ]; then
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 exit 1
fi fi
# Get the tarball URL for the specific release # Fetch the tarball URL for the latest release using the GitHub API
tarball_url=$(echo "$release_info" | grep "tarball_url" | cut -d '"' -f 4) latest_tarball_url=$(curl -s https://api.github.com/repos/JaKooLit/Hyprland-Dots/releases/latest | grep "tarball_url" | cut -d '"' -f 4)
# Check if the URL is obtained successfully # Check if the URL is obtained successfully
if [ -z "$tarball_url" ]; then if [ -z "$latest_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" 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 exit 1
fi fi
# Download the specific release source code tarball to the current directory # Get the filename from the URL and include the tag name in the file name
if curl -L "$tarball_url" -o "Hyprland-Dots-${specific_version}.tar.gz"; then file_name="Hyprland-Dots-${latest_tag}.tar.gz"
# Extract the contents of the tarball
tar -xzf "Hyprland-Dots-${specific_version}.tar.gz" || exit 1
# Delete existing Hyprland-Dots # Download the latest release source code tarball to the current directory
if curl -L "$latest_tarball_url" -o "$file_name"; then
# Extract the contents of the tarball
tar -xzf "$file_name" || exit 1
# delete existing Hyprland-Dots
rm -rf JaKooLit-Hyprland-Dots rm -rf JaKooLit-Hyprland-Dots
# Identify the extracted directory # Identify the extracted directory
extracted_directory=$(tar -tf "Hyprland-Dots-${specific_version}.tar.gz" | grep -o '^[^/]\+' | uniq) extracted_directory=$(tar -tf "$file_name" | grep -o '^[^/]\+' | uniq)
# Rename the extracted directory to JaKooLit-Hyprland-Dots # Rename the extracted directory to JaKooLit-Hyprland-Dots
mv "$extracted_directory" JaKooLit-Hyprland-Dots || exit 1 mv "$extracted_directory" JaKooLit-Hyprland-Dots || exit 1
@ -56,9 +91,9 @@ if curl -L "$tarball_url" -o "Hyprland-Dots-${specific_version}.tar.gz"; then
chmod +x copy.sh chmod +x copy.sh
./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} 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 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" 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 exit 1
fi fi

60
install-scripts/hypridle.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# hypidle #
idle=(
libsdbus-c++-dev
)
## 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-Logs/install-$(date +%d-%H%M%S)_hypridle.log"
MLOG="install-$(date +%d-%H%M%S)_hypridle.log"
# Installation of dependencies
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 install had failed, please check the install.log"
exit 1
fi
done
# Check if hypridle folder exists and remove it
if [ -d "hypridle" ]; then
printf "${NOTE} Removing existing hypridle folder...\n"
rm -rf "hypridle"
fi
# Clone and build
printf "${NOTE} Installing hypridle...\n"
if git clone 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
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
cd ..
else
echo -e "${ERROR} Download failed for hypridle." 2>&1 | tee -a "$LOG"
fi
clear

59
install-scripts/hyprlock.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# hyprlock #
lock=(
libmagic-dev
)
## 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-Logs/install-$(date +%d-%H%M%S)_hyprlock.log"
MLOG="install-$(date +%d-%H%M%S)_hyprlock.log"
# Installation of dependencies
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 install had failed, please check the install.log"
exit 1
fi
done
# Check if hyprlidle folder exists and remove it
if [ -d "hyprlock" ]; then
printf "${NOTE} Removing existing hyprlock folder...\n"
rm -rf "hyprlock"
fi
# Clone and build hyprlock
printf "${NOTE} Installing hyprlock...\n"
if git clone 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
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
cd ..
else
echo -e "${ERROR} Download failed for hyprlock." 2>&1 | tee -a "$LOG"
fi
clear

View File

@ -1,44 +0,0 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# Swaylock Effects #
## 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-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
if [ -d "swaylock-effects" ]; then
printf "${NOTE} swaylock-effects folder exists. Pulling latest changes...\n"
cd swaylock-effects || exit 1
git pull origin master 2>&1 | tee -a "$MLOG"
else
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
# 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

View File

@ -84,7 +84,6 @@ nvidia=""
nwg="" nwg=""
rog="" rog=""
sddm="" sddm=""
swaylock=""
thunar="" thunar=""
xdph="" xdph=""
zsh="" zsh=""
@ -155,8 +154,6 @@ ask_yes_no "-Install XDG-DESKTOP-PORTAL-HYPRLAND? (For proper Screen Share ie OB
printf "\n" printf "\n"
ask_yes_no "-Install zsh & oh-my-zsh plus (OPTIONAL) pokemon-colorscripts for tty?" zsh ask_yes_no "-Install zsh & oh-my-zsh plus (OPTIONAL) pokemon-colorscripts for tty?" zsh
printf "\n" printf "\n"
ask_yes_no "-Install swaylock-effects? (recommended - for screen locks)" swaylock
printf "\n"
ask_yes_no "-Install nwg-look? (a GTK Theming app - lxappearance-like) WARN! This Package Takes long time to build!" nwg ask_yes_no "-Install nwg-look? (a GTK Theming app - lxappearance-like) WARN! This Package Takes long time to build!" nwg
printf "\n" printf "\n"
ask_yes_no "-Installing on Asus ROG Laptops?" rog ask_yes_no "-Installing on Asus ROG Laptops?" rog
@ -179,6 +176,8 @@ execute_script "rofi-wayland.sh"
execute_script "pywal.sh" execute_script "pywal.sh"
execute_script "force-install.sh" execute_script "force-install.sh"
execute_script "hyprlang.sh" execute_script "hyprlang.sh"
execute_script "hyprlock.sh"
execute_script "hyprlidle.sh"
#execute_script "cliphist.sh" #execute_script "cliphist.sh"
@ -214,10 +213,6 @@ if [ "$zsh" == "Y" ]; then
execute_script "zsh.sh" execute_script "zsh.sh"
fi fi
if [ "$swaylock" == "Y" ]; then
execute_script "swaylock-effects.sh"
fi
if [ "$nwg" == "Y" ]; then if [ "$nwg" == "Y" ]; then
execute_script "nwg-look.sh" execute_script "nwg-look.sh"
fi fi