Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Hyprland.sh #142

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor Hyprland.sh and update readme
  • Loading branch information
brrock committed Aug 14, 2024
commit 20fbe6baf3156565a71b1c15745fd8f53a5d964c
57 changes: 57 additions & 0 deletions Install-Logs/install-14-132650_hyprland.log
Original file line number Diff line number Diff line change
@@ -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...
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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">
<br>
<a href="#--ubuntu-2404-lts-noble-numbat-hyprland-install-script-branch-"><kbd> <br> Ubuntu 24.04 LTS <br> </kbd></a>&ensp;&ensp;
Expand Down
66 changes: 34 additions & 32 deletions install-scripts/hyprland.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# Main Hyprland Package#

#specific branch or release
hyprland_tag="v0.41.2"

hyprland=(
libxcb-errors-dev
libxcb-errors-dev
hyprland
)

## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
# Determine the directory where the script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.."
Expand All @@ -24,42 +24,44 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland.log"
MLOG="install-$(date +%d-%H%M%S)_hyprland2.log"

# Installation of dependencies
printf "\n%s - Installing hyprland additional dependencies.... \n" "${NOTE}"

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 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

# Clone, build, and install Hyprland using Cmake
printf "${NOTE} Cloning Hyprland...\n"
printf "${NOTE} Installing Hyprland"

# 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"
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
#!/bin/bash

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"
# Get the OS name from the release file
os_name=$(grep '^NAME=' /etc/os-release | tr -d '"' | cut -d= -f2)

clear
# 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
clear