From 9d7c47195acead56a7836be85b86ea5fd1a02165 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 9 Mar 2025 23:37:03 +0900 Subject: Added Distro-Hyprland.sh --- Distro-Hyprland.sh | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100755 Distro-Hyprland.sh (limited to 'Distro-Hyprland.sh') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh new file mode 100755 index 00000000..b367b013 --- /dev/null +++ b/Distro-Hyprland.sh @@ -0,0 +1,141 @@ +#!/bin/bash +# https://github.com/JaKooLit + +# Script design to clone the Distro-Hyprland install scripts + +# Set some colors for output messages +OK="$(tput setaf 2)[OK]$(tput sgr0)" +ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" +NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" +INFO="$(tput setaf 4)[INFO]$(tput sgr0)" +WARN="$(tput setaf 1)[WARN]$(tput sgr0)" +CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" +MAGENTA="$(tput setaf 5)" +ORANGE="$(tput setaf 214)" +WARNING="$(tput setaf 1)" +YELLOW="$(tput setaf 3)" +GREEN="$(tput setaf 2)" +BLUE="$(tput setaf 4)" +SKY_BLUE="$(tput setaf 6)" +RESET="$(tput sgr0)" + +# Detect the current distribution using /etc/os-release +if [ -f /etc/os-release ]; then + . /etc/os-release + distro_name=$NAME + distro_version=$VERSION_ID +else + echo "${ERROR} Unable to detect the distribution. Exiting." + exit 1 +fi + +# Define package managers, Git install commands, and dynamic variables for each distro +if [ "$distro_name" == "Arch Linux" ]; then + PACKAGE_MANAGER="pacman" + INSTALL_CMD="sudo pacman -S --noconfirm" + GIT_INSTALL_CMD="sudo pacman -S git --noconfirm" + Distro="Arch-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif [ "$distro_name" == "Fedora" ]; then + PACKAGE_MANAGER="dnf" + INSTALL_CMD="sudo dnf install -y" + GIT_INSTALL_CMD="sudo dnf install -y git" + Distro="Fedora-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif [ "$distro_name" == "openSUSE" ]; then + PACKAGE_MANAGER="zypper" + INSTALL_CMD="sudo zypper install -y" + GIT_INSTALL_CMD="sudo zypper install -y git" + Distro="OpenSUSE-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif [ "$distro_name" == "NixOS" ]; then + PACKAGE_MANAGER="nix" + INSTALL_CMD="nix-shell" + GIT_INSTALL_CMD="nix-shell -p git curl pciutils" + Distro="NixOS-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif [ "$distro_name" == "Debian" ]; then + PACKAGE_MANAGER="apt" + INSTALL_CMD="sudo apt install -y" + GIT_INSTALL_CMD="sudo apt install -y git" + Distro="Debian-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif [ "$distro_name" == "Ubuntu" ]; then + PACKAGE_MANAGER="apt" + INSTALL_CMD="sudo apt install -y" + GIT_INSTALL_CMD="sudo apt install -y git" + + case "$distro_version" in + "24.04") + Distro="Ubuntu-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Github_URL_branch="24.04" + Distro_DIR="$HOME/$Distro" + echo "${INFO} Ubuntu 24.04 detected. Customizing setup for Ubuntu 24.04." + ;; + "24.10") + Distro="Ubuntu-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Github_URL_branch="24.10" + Distro_DIR="$HOME/$Distro" + echo "${INFO} Ubuntu 24.10 detected. Customizing setup for Ubuntu 24.10." + ;; + "25.04") + Distro="Ubuntu-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Github_URL_branch="25.04" + Distro_DIR="$HOME/$Distro" + echo "${INFO} Ubuntu 25.04 detected. Customizing setup for Ubuntu 25.04." + ;; + *) + Distro="Ubuntu-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" + echo "${INFO} Ubuntu version $distro_version detected. Using default Ubuntu setup." + ;; + esac +else + echo "${ERROR} Unsupported distribution: $distro_name. Exiting." + exit 1 +fi + +# Check for Git and install if not found +printf "\n%.0s" {1..1} + +if ! command -v git &> /dev/null +then + echo "${INFO} Git not found! ${SKY_BLUE}Installing Git...${RESET}" + if ! $GIT_INSTALL_CMD; then + echo "${ERROR} Failed to install Git. Exiting." + exit 1 + fi +fi + +# Check if the directory already exists and perform clone or update +printf "\n%.0s" {1..1} + +if [ -d "$Distro_DIR" ]; then + echo "${YELLOW}$Distro_DIR exists. Updating the repository... ${RESET}" + cd "$Distro_DIR" + git stash && git pull + chmod +x install.sh + ./install.sh +else + echo "${MAGENTA}$Distro_DIR does not exist. Cloning the repository...${RESET}" + + # Clone the specific branch for Ubuntu versions only + if [ "$distro_name" == "Ubuntu" ]; then + git clone --depth=1 -b "$Github_URL_branch" "$Github_URL" "$Distro_DIR" + else + git clone --depth=1 "$Github_URL" "$Distro_DIR" + fi + + cd "$Distro_DIR" + chmod +x install.sh + ./install.sh +fi -- cgit v1.2.3 From 9ced69fb62fd71e0f9363e10b851c6a960ec35df Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 10 Mar 2025 00:05:24 +0900 Subject: updated for Debian --- Distro-Hyprland.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Distro-Hyprland.sh') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh index b367b013..94ac0a08 100755 --- a/Distro-Hyprland.sh +++ b/Distro-Hyprland.sh @@ -58,7 +58,7 @@ elif [ "$distro_name" == "NixOS" ]; then Distro="NixOS-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "Debian" ]; then +elif [ "$distro_name" == "Debian GNU/Linux" ]; then PACKAGE_MANAGER="apt" INSTALL_CMD="sudo apt install -y" GIT_INSTALL_CMD="sudo apt install -y git" -- cgit v1.2.3 From dfd430055a153a01a44cc9519d7dac4d1189352d Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 10 Mar 2025 00:19:23 +0900 Subject: adjusted to use package manager instead --- Distro-Hyprland.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'Distro-Hyprland.sh') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh index 94ac0a08..7eb4d39f 100755 --- a/Distro-Hyprland.sh +++ b/Distro-Hyprland.sh @@ -30,28 +30,28 @@ else fi # Define package managers, Git install commands, and dynamic variables for each distro -if [ "$distro_name" == "Arch Linux" ]; then +if command -v pacman &> /dev/null; then PACKAGE_MANAGER="pacman" INSTALL_CMD="sudo pacman -S --noconfirm" GIT_INSTALL_CMD="sudo pacman -S git --noconfirm" Distro="Arch-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "Fedora" ]; then +elif command -v dnf &> /dev/null; then PACKAGE_MANAGER="dnf" INSTALL_CMD="sudo dnf install -y" GIT_INSTALL_CMD="sudo dnf install -y git" Distro="Fedora-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "openSUSE" ]; then +elif command -v zypper &> /dev/null; then PACKAGE_MANAGER="zypper" INSTALL_CMD="sudo zypper install -y" GIT_INSTALL_CMD="sudo zypper install -y git" Distro="OpenSUSE-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "NixOS" ]; then +elif command -v nix &> /dev/null; then PACKAGE_MANAGER="nix" INSTALL_CMD="nix-shell" GIT_INSTALL_CMD="nix-shell -p git curl pciutils" @@ -105,10 +105,7 @@ else fi # Check for Git and install if not found -printf "\n%.0s" {1..1} - -if ! command -v git &> /dev/null -then +if ! command -v git &> /dev/null; then echo "${INFO} Git not found! ${SKY_BLUE}Installing Git...${RESET}" if ! $GIT_INSTALL_CMD; then echo "${ERROR} Failed to install Git. Exiting." @@ -117,8 +114,6 @@ then fi # Check if the directory already exists and perform clone or update -printf "\n%.0s" {1..1} - if [ -d "$Distro_DIR" ]; then echo "${YELLOW}$Distro_DIR exists. Updating the repository... ${RESET}" cd "$Distro_DIR" @@ -130,6 +125,7 @@ else # Clone the specific branch for Ubuntu versions only if [ "$distro_name" == "Ubuntu" ]; then + echo "${INFO} Cloning from branch ${Github_URL_branch} for Ubuntu $distro_version." git clone --depth=1 -b "$Github_URL_branch" "$Github_URL" "$Distro_DIR" else git clone --depth=1 "$Github_URL" "$Distro_DIR" -- cgit v1.2.3 From a57353a4d95ab8f6279e77d9da3df246f8fc00d0 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 10 Mar 2025 00:20:24 +0900 Subject: updated for nixos --- Distro-Hyprland.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Distro-Hyprland.sh') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh index 7eb4d39f..b92fa1f9 100755 --- a/Distro-Hyprland.sh +++ b/Distro-Hyprland.sh @@ -51,7 +51,7 @@ elif command -v zypper &> /dev/null; then Distro="OpenSUSE-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif command -v nix &> /dev/null; then +elif [ "$distro_name" == "NixOS" ]; then PACKAGE_MANAGER="nix" INSTALL_CMD="nix-shell" GIT_INSTALL_CMD="nix-shell -p git curl pciutils" -- cgit v1.2.3 From 8fb7cccc56aef190a165d3998b06e0d8824f0b87 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 10 Mar 2025 00:25:28 +0900 Subject: some changes --- Distro-Hyprland.sh | 60 +++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'Distro-Hyprland.sh') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh index b92fa1f9..0be7c4f6 100755 --- a/Distro-Hyprland.sh +++ b/Distro-Hyprland.sh @@ -30,35 +30,7 @@ else fi # Define package managers, Git install commands, and dynamic variables for each distro -if command -v pacman &> /dev/null; then - PACKAGE_MANAGER="pacman" - INSTALL_CMD="sudo pacman -S --noconfirm" - GIT_INSTALL_CMD="sudo pacman -S git --noconfirm" - Distro="Arch-Hyprland" - Github_URL="https://github.com/JaKooLit/$Distro.git" - Distro_DIR="$HOME/$Distro" -elif command -v dnf &> /dev/null; then - PACKAGE_MANAGER="dnf" - INSTALL_CMD="sudo dnf install -y" - GIT_INSTALL_CMD="sudo dnf install -y git" - Distro="Fedora-Hyprland" - Github_URL="https://github.com/JaKooLit/$Distro.git" - Distro_DIR="$HOME/$Distro" -elif command -v zypper &> /dev/null; then - PACKAGE_MANAGER="zypper" - INSTALL_CMD="sudo zypper install -y" - GIT_INSTALL_CMD="sudo zypper install -y git" - Distro="OpenSUSE-Hyprland" - Github_URL="https://github.com/JaKooLit/$Distro.git" - Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "NixOS" ]; then - PACKAGE_MANAGER="nix" - INSTALL_CMD="nix-shell" - GIT_INSTALL_CMD="nix-shell -p git curl pciutils" - Distro="NixOS-Hyprland" - Github_URL="https://github.com/JaKooLit/$Distro.git" - Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "Debian GNU/Linux" ]; then +if [ "$distro_name" == "Debian GNU/Linux" ]; then PACKAGE_MANAGER="apt" INSTALL_CMD="sudo apt install -y" GIT_INSTALL_CMD="sudo apt install -y git" @@ -99,6 +71,34 @@ elif [ "$distro_name" == "Ubuntu" ]; then echo "${INFO} Ubuntu version $distro_version detected. Using default Ubuntu setup." ;; esac +elif command -v pacman &> /dev/null; then + PACKAGE_MANAGER="pacman" + INSTALL_CMD="sudo pacman -S --noconfirm" + GIT_INSTALL_CMD="sudo pacman -S git --noconfirm" + Distro="Arch-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif command -v dnf &> /dev/null; then + PACKAGE_MANAGER="dnf" + INSTALL_CMD="sudo dnf install -y" + GIT_INSTALL_CMD="sudo dnf install -y git" + Distro="Fedora-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif command -v zypper &> /dev/null; then + PACKAGE_MANAGER="zypper" + INSTALL_CMD="sudo zypper install -y" + GIT_INSTALL_CMD="sudo zypper install -y git" + Distro="OpenSUSE-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" +elif [ "$distro_name" == "NixOS" ]; then + PACKAGE_MANAGER="nix" + INSTALL_CMD="nix-shell" + GIT_INSTALL_CMD="nix-shell -p git curl pciutils" + Distro="NixOS-Hyprland" + Github_URL="https://github.com/JaKooLit/$Distro.git" + Distro_DIR="$HOME/$Distro" else echo "${ERROR} Unsupported distribution: $distro_name. Exiting." exit 1 @@ -134,4 +134,4 @@ else cd "$Distro_DIR" chmod +x install.sh ./install.sh -fi +fi \ No newline at end of file -- cgit v1.2.3 From 76a3903bb29294f86acdf1f40995d9e4471ce07f Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 10 Mar 2025 00:30:19 +0900 Subject: some changes --- Distro-Hyprland.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Distro-Hyprland.sh') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh index 0be7c4f6..ff0bae03 100755 --- a/Distro-Hyprland.sh +++ b/Distro-Hyprland.sh @@ -30,14 +30,14 @@ else fi # Define package managers, Git install commands, and dynamic variables for each distro -if [ "$distro_name" == "Debian GNU/Linux" ]; then +if [ "$distro_name" = "Debian GNU/Linux" ]; then PACKAGE_MANAGER="apt" INSTALL_CMD="sudo apt install -y" GIT_INSTALL_CMD="sudo apt install -y git" Distro="Debian-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "Ubuntu" ]; then +elif [ "$distro_name" = "Ubuntu" ]; then PACKAGE_MANAGER="apt" INSTALL_CMD="sudo apt install -y" GIT_INSTALL_CMD="sudo apt install -y git" @@ -92,7 +92,7 @@ elif command -v zypper &> /dev/null; then Distro="OpenSUSE-Hyprland" Github_URL="https://github.com/JaKooLit/$Distro.git" Distro_DIR="$HOME/$Distro" -elif [ "$distro_name" == "NixOS" ]; then +elif [ "$distro_name" = "NixOS" ]; then PACKAGE_MANAGER="nix" INSTALL_CMD="nix-shell" GIT_INSTALL_CMD="nix-shell -p git curl pciutils" @@ -124,7 +124,7 @@ else echo "${MAGENTA}$Distro_DIR does not exist. Cloning the repository...${RESET}" # Clone the specific branch for Ubuntu versions only - if [ "$distro_name" == "Ubuntu" ]; then + if [ "$distro_name" = "Ubuntu" ]; then echo "${INFO} Cloning from branch ${Github_URL_branch} for Ubuntu $distro_version." git clone --depth=1 -b "$Github_URL_branch" "$Github_URL" "$Distro_DIR" else @@ -134,4 +134,4 @@ else cd "$Distro_DIR" chmod +x install.sh ./install.sh -fi \ No newline at end of file +fi -- cgit v1.2.3