diff --git a/README.md b/README.md index 999ec4f..02b2248 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ML4W Hyprland Starter 1.0.0 +# ML4W Hyprland Starter 1.0.1 The ML4W Hyprland Starter package is the perfect starting point for your Hyprland customization experiments. @@ -13,6 +13,7 @@ Watch on YouTube: https://youtu.be/jc-vFSXpZF4 Ths script supports the following distributions: * Arch Linux (+ Arch Linux based distros e.g., EndeavourOS, Manjaro, ...) * Fedora Linux +* Nobara Linux * more to come soon... ## Documentation (Wiki) diff --git a/install.sh b/install.sh index e6bce7c..a78e9d1 100755 --- a/install.sh +++ b/install.sh @@ -30,12 +30,12 @@ source install/includes/checkdistro.sh # ----------------------------------------------------- # Load Library for used distro # ----------------------------------------------------- -source install/$distro/library.sh +source install/$installer/library.sh # ----------------------------------------------------- # Install required packages # ----------------------------------------------------- -source install/$distro/install_required.sh +source install/$installer/install_required.sh # ----------------------------------------------------- # Confirm Start @@ -50,7 +50,7 @@ source install/includes/preparation.sh # ----------------------------------------------------- # Install Hyprland Packages # ----------------------------------------------------- -source install/$distro/install_packages.sh +source install/$installer/install_packages.sh # ----------------------------------------------------- # Create Backup diff --git a/install/arch/install_required.sh b/install/arch/install_required.sh index 82ca03b..b354a79 100644 --- a/install/arch/install_required.sh +++ b/install/arch/install_required.sh @@ -11,7 +11,7 @@ installer_packages=( "git" ) -echo ":: Installing on Arch" +echo ":: Installing on $distro" # Synchronizing package databases sudo pacman -Sy diff --git a/install/fedora/gum.sh b/install/fedora/gum.sh new file mode 100755 index 0000000..ab7279f --- /dev/null +++ b/install/fedora/gum.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo '[charm] +name=Charm +baseurl=https://repo.charm.sh/yum/ +enabled=1 +gpgcheck=1 +gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo +sudo yum install gum \ No newline at end of file diff --git a/install/fedora/install_required.sh b/install/fedora/install_required.sh index 720cc84..0163d0f 100644 --- a/install/fedora/install_required.sh +++ b/install/fedora/install_required.sh @@ -11,20 +11,8 @@ installer_packages=( "git" ) -echo ":: Installing on Fedora" +echo ":: Installing on $distro" _installPackages "${installer_packages[@]}"; # Install gum -if [[ $(_isInstalled "gum") == 1 ]]; then - -echo '[charm] -name=Charm -baseurl=https://repo.charm.sh/yum/ -enabled=1 -gpgcheck=1 -gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo -sudo yum install --assumeyes gum - -else - echo "gum is already installed."; -fi +install/fedora/gum.sh diff --git a/install/includes/checkdistro.sh b/install/includes/checkdistro.sh index 55c8dec..8f5ac07 100644 --- a/install/includes/checkdistro.sh +++ b/install/includes/checkdistro.sh @@ -1,23 +1,57 @@ distro="" +installer="" + +# Check for distro if [ -z "$1" ] ;then if [ -f /etc/fedora-release ] ;then distro="fedora" + installer="fedora" fi if [ -f /etc/arch-release ] ;then distro="arch" + installer="arch" + fi + if [ -f /etc/nobara-release ] ;then + distro="nobara" + installer="fedora" fi else + if [[ "$1" == "nobara" ]]; then + distro="nobara" + installer="fedora" + fi if [[ "$1" == "fedora" ]]; then distro="fedora" + installer="fedora" fi if [[ "$1" == "arch" ]]; then distro="arch" + installer="arch" fi fi +# Select installer manually if [ -z $distro ] ;then - echo "ERROR: Your Linux distribution is not supported." - exit + echo "ERROR: Your Linux distribution could not be detected or is not supported." + echo + echo "Please select one of the following installation profiles or cancel the installation." + echo + version=$(gum choose "arch" "fedora" "cancel") + if [ "$version" == "arch" ] ;then + echo ":: Installer for Arch" + distro="arch" + installer="arch" + elif [ "$version" == "rolling-release" ] ;then + echo ":: Installer for Fedora" + distro="fedora" + installer="fedora" + elif [ "$version" == "cancel" ] ;then + echo ":: Setup canceled" + exit 130 + else + echo ":: Setup canceled" + exit 130 + fi fi echo "$distro" > dotfiles/.config/ml4w/settings/distro diff --git a/install/version b/install/version index 9f8e9b6..7f20734 100644 --- a/install/version +++ b/install/version @@ -1 +1 @@ -1.0 \ No newline at end of file +1.0.1 \ No newline at end of file diff --git a/setup.sh b/setup.sh index 2312641..32462c6 100755 --- a/setup.sh +++ b/setup.sh @@ -4,13 +4,25 @@ # Functions # ----------------------------------------------------- +distro="" +installer="" + # Detect Linux Distribution _detectDistro() { if [ -f /etc/fedora-release ] ;then - echo "fedora" + distro="fedora" + installer="fedora" + echo ":: Installer for Fedora" + fi + if [ -f /etc/nobara-release ] ;then + distro="nobara" + installer="fedora" + echo ":: Installer for Nobara" fi if [ -f /etc/arch-release ] ;then - echo "arch" + distro="arch" + installer="arch" + echo ":: Installer for Arch" fi } @@ -130,22 +142,48 @@ while true; do esac done +# ----------------------------------------------------- +# Detect Distribution +# ----------------------------------------------------- +_detectDistro +if [ -z $distro ] ;then + echo "ERROR: Your Linux distribution could not be detected or is not supported." + echo + echo "Please select one of the following installation profiles or cancel the installation." + echo + version=$(gum choose "arch" "fedora" "cancel") + if [ "$version" == "arch" ] ;then + echo ":: Installer for Arch" + distro="arch" + installer="arch" + elif [ "$version" == "rolling-release" ] ;then + echo ":: Installer for Fedora" + distro="fedora" + installer="fedora" + elif [ "$version" == "cancel" ] ;then + echo ":: Setup canceled" + exit 130 + else + echo ":: Setup canceled" + exit 130 + fi +fi + # ----------------------------------------------------- # Installation for Fedora # ----------------------------------------------------- -if [ $(_detectDistro) == "fedora" ] ;then - echo ":: Installing on Fedora" +if [ "$installer" == "fedora" ] ;then _installPackagesFedora "${installer_packages_fedora[@]}"; fi # ----------------------------------------------------- # Installation for Arch # ----------------------------------------------------- -if [ $(_detectDistro) == "arch" ] ;then - echo ":: Installing on Arch" +if [ "$installer" == "arch" ] ;then _installPackagesPacman "${installer_packages_arch[@]}"; fi +# Create Downloads folder if not exists if [ ! -d ~/Downloads ] ;then mkdir ~/Downloads echo ":: Downloads folder created"