From 14e487e576feb5cc6f8b607f10bb35cc9e934e2d Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Fri, 12 Jan 2024 10:02:08 +0900 Subject: [PATCH] added hyprlang installation --- CHANGELOGS.md | 1 + install-scripts/hyprlang.sh | 48 +++++++++++++++++++++++++++++++++++++ install-scripts/xdph.sh | 3 +-- install.sh | 1 + 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100755 install-scripts/hyprlang.sh diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 33ddea0..50e0e34 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -2,6 +2,7 @@ ## 11 Jan 2024 - dropped wlsunset +- added hyprlang build and install ## 02 Jan 2024 - Readme updated for cliphist instruction for ubuntu 23.10 users diff --git a/install-scripts/hyprlang.sh b/install-scripts/hyprlang.sh new file mode 100755 index 0000000..d4908f0 --- /dev/null +++ b/install-scripts/hyprlang.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# hyprlang - hyprland and xdg-desktop-portal- dependencies # + +## 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)_hyprlang.log" +MLOG="install-$(date +%d-%H%M%S)_hyprlang2.log" + +## +printf "${NOTE} Installing hyprlang...\n" + +# Check if hyprlang folder exists and remove it +if [ -d "hyprlang" ]; then + printf "${NOTE} Removing existing hyprlang folder...\n" + rm -rf "hyprlang" +fi + +# Clone and build hyprlang +printf "${NOTE} Installing hyprlang...\n" +if git clone 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 + 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 + cd .. +else + echo -e "${ERROR} Download failed for hyprlang." 2>&1 | tee -a "$LOG" +fi + + +clear + diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh index 0757ef9..e68d6f7 100755 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -47,8 +47,7 @@ if git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland; mv $MLOG ../Install-Logs/ || true cd .. else - echo -e "${ERROR} Download failed for xdg-desktop-portal-hyprland." 2>&1 | tee -a "$MLOG" - mv $MLOG Install-Logs/ || true + echo -e "${ERROR} Download failed for xdg-desktop-portal-hyprland." 2>&1 | tee -a "$LOG" fi printf "\n\n" diff --git a/install.sh b/install.sh index 0b40bf6..f71d227 100755 --- a/install.sh +++ b/install.sh @@ -171,6 +171,7 @@ execute_script "swww.sh" execute_script "rofi-wayland.sh" execute_script "pywal.sh" execute_script "force-install.sh" +execute_script "hyprlang.sh" #execute_script "cliphist.sh"