Skip to content

Commit

Permalink
Merge pull request #14 from mylinuxforwork/6-feature-nobara
Browse files Browse the repository at this point in the history
6 feature nobara
  • Loading branch information
mylinuxforwork authored Jul 25, 2024
2 parents ecd207b + 028a77b commit ef19835
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 28 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion install/arch/install_required.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ installer_packages=(
"git"
)

echo ":: Installing on Arch"
echo ":: Installing on $distro"

# Synchronizing package databases
sudo pacman -Sy
Expand Down
8 changes: 8 additions & 0 deletions install/fedora/gum.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 2 additions & 14 deletions install/fedora/install_required.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 36 additions & 2 deletions install/includes/checkdistro.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion install/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0
1.0.1
50 changes: 44 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit ef19835

Please sign in to comment.