Refactor Hyprland.sh and update readme

This commit is contained in:
brrock 2024-08-14 13:26:54 +01:00
parent 9b1b12f100
commit 20fbe6baf3
3 changed files with 93 additions and 35 deletions

View File

@ -0,0 +1,57 @@
[NOTE](B Installing libxcb-errors-dev ...
Reading package lists...Reading package lists...
Building dependency tree...Building dependency tree...
Reading state information...
Reading state information...
The following NEW packages will be installed:
The following NEW packages will be installed:
libxcb-errors-dev
libxcb-errors-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.1 kB of archives.
After this operation, 72.7 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian trixie/main amd64 libxcb-errors-dev amd64 1.0.1-2 [18.1 kB]
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.1 kB of archives.
After this operation, 72.7 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian trixie/main amd64 libxcb-errors-dev amd64 1.0.1-2 [18.1 kB]
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Fetched 18.1 kB in 0s (101 kB/s)
Fetched 18.1 kB in 0s (101 kB/s)
Selecting previously unselected package libxcb-errors-dev.
(Reading database ... Selecting previously unselected package libxcb-errors-dev.
(Reading database ... (Reading database ... 5%(Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 65% (Reading database ... 70%(Reading database ... 70% (Reading database ... 75% (Reading database ... 75% (Reading database ... 80% (Reading database ... 80% (Reading database ... 85% (Reading database ... 85% (Reading database ... 90% (Reading database ... 90% (Reading database ... 95% (Reading database ... 95% (Reading database ... 100% (Reading database ... 132086 files and directories currently installed.)
(Reading database ... 100% (Reading database ... 132086 files and directories currently installed.)
Preparing to unpack .../libxcb-errors-dev_1.0.1-2_amd64.deb ...
Preparing to unpack .../libxcb-errors-dev_1.0.1-2_amd64.deb ...
Unpacking libxcb-errors-dev (1.0.1-2) ...
Unpacking libxcb-errors-dev (1.0.1-2) ...
Setting up libxcb-errors-dev (1.0.1-2) ...
Setting up libxcb-errors-dev (1.0.1-2) ...
[OK](B libxcb-errors-dev was installed.
[OK](B hyprland is already installed. Skipping...
[OK](B libxcb-errors-dev is already installed. Skipping...
[OK](B hyprland is already installed. Skipping...

View File

@ -1,4 +1,3 @@
# ⚠️ NOTE: 08-08-2024 - Hyprland is on Debian Trixie and SID official repo. Including Ubuntu universe repo. However, because I am busy with work and travelling, I cannot adjust the script. Estimated by the End of Aug 2024 that I can adjust Debian and Ubuntu Install-Scripts. I'm updating
<div align="center"> <div align="center">
<br> <br>
<a href="#--ubuntu-2404-lts-noble-numbat-hyprland-install-script-branch-"><kbd><br>Ubuntu 24.04 LTS<br></kbd></a>&ensp;&ensp; <a href="#--ubuntu-2404-lts-noble-numbat-hyprland-install-script-branch-"><kbd><br>Ubuntu 24.04 LTS<br></kbd></a>&ensp;&ensp;

View File

@ -3,15 +3,15 @@
# Main Hyprland Package# # Main Hyprland Package#
#specific branch or release #specific branch or release
hyprland_tag="v0.41.2"
hyprland=( hyprland=(
libxcb-errors-dev libxcb-errors-dev
hyprland
) )
## 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! ##
# 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)"
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
@ -24,42 +24,44 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland.log"
MLOG="install-$(date +%d-%H%M%S)_hyprland2.log" MLOG="install-$(date +%d-%H%M%S)_hyprland2.log"
# Installation of dependencies # Installation of dependencies
printf "\n%s - Installing hyprland additional dependencies.... \n" "${NOTE}"
for PKG1 in "${hyprland[@]}"; do for PKG1 in "${hyprland[@]}"; do
install_package "$PKG1" 2>&1 | tee -a "$LOG" install_package "$PKG1" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs"
exit 1 exit 1
fi fi
done done
# Clone, build, and install Hyprland using Cmake # Clone, build, and install Hyprland using Cmake
printf "${NOTE} Cloning Hyprland...\n" printf "${NOTE} Installing Hyprland"
# Check if Hyprland folder exists and remove it # Check if Hyprland folder exists and remove it
if [ -d "Hyprland" ]; then #!/bin/bash
printf "${NOTE} Removing existing Hyprland folder...\n"
rm -rf "Hyprland" 2>&1 | tee -a "$LOG" # Get the OS name from the release file
os_name=$(grep '^NAME=' /etc/os-release | tr -d '"' | cut -d= -f2)
# Check if the OS is Debian or Ubuntu
if [[ "$os_name" == "Debian GNU/Linux" ]]; then
for PKG1 in "${hyprland[@]}"; do
install_package "$PKG1" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then
echo -e "\e[1A\e[K${ERROR} - $PKG1 Hyprland installation failed, Please check the installation logs"
exit 1
fi
done
elif [[ "$os_name" == "Ubuntu" ]]; then
printf "${NOTE} Adding Universe repo"
sudo add-apt-repository universe
sudo apt update
for PKG1 in "${hyprland[@]}"; do
install_package "$PKG1" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then
echo -e "\e[1A\e[K${ERROR} - $PKG1 Hyprland installation failed, Please check the installation logs"
exit 1
fi
done
fi 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 ..
else
echo -e "${ERROR} Download failed for Hyprland." 2>&1 | tee -a "$LOG"
fi
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"
clear clear