diff --git a/core/src/inner.rs b/core/src/inner.rs index a3a0fc9c..fda703b8 100644 --- a/core/src/inner.rs +++ b/core/src/inner.rs @@ -132,14 +132,15 @@ impl Entry { match data { SystemDataType::Environment(var_name) => std::env::var(var_name) .is_ok_and(|var| values.contains(&var) == *matches), - SystemDataType::File(path) => { - std::fs::read_to_string(path).is_ok_and(|data| { - values.iter().all(|matching| data.contains(matching)) == *matches - }) - } + SystemDataType::File(path) => path.exists() == *matches, SystemDataType::CommandExists => values .iter() .all(|command| which::which(command).is_ok() == *matches), + SystemDataType::FileContains { file, contains } => { + std::fs::read_to_string(file) + .map(|content| content.contains(contains) == *matches) + .unwrap_or(false) + } } }, ) @@ -164,6 +165,11 @@ enum SystemDataType { File(PathBuf), #[serde(rename = "command_exists")] CommandExists, + #[serde(untagged)] + FileContains { + file: PathBuf, + contains: String, + }, } fn filter_entries(entries: &mut Vec) { diff --git a/core/tabs/system-setup/arch/hyprland-kool.sh b/core/tabs/system-setup/arch/hyprland-kool.sh new file mode 100644 index 00000000..0773f77a --- /dev/null +++ b/core/tabs/system-setup/arch/hyprland-kool.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Check if base-devel is installed, install if not +if ! pacman -Q base-devel &>/dev/null; then + echo "Installing base-devel..." + sudo pacman -S --noconfirm base-devel +fi + +git clone --depth=1 https://github.com/JaKooLit/Arch-Hyprland.git ~/Arch-Hyprland +cd ~/Arch-Hyprland +chmod +x install.sh +./install.sh diff --git a/core/tabs/system-setup/debian/hyprland-kool-deb.sh b/core/tabs/system-setup/debian/hyprland-kool-deb.sh new file mode 100644 index 00000000..9a64ad72 --- /dev/null +++ b/core/tabs/system-setup/debian/hyprland-kool-deb.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Hyprland Kool" +git clone --depth=1 https://github.com/JaKooLit/Debian-Hyprland.git ~/Debian-Hyprland +cd ~/Debian-Hyprland +chmod +x install.sh +./install.sh \ No newline at end of file diff --git a/core/tabs/system-setup/fedora/hyprland-kool-fed.sh b/core/tabs/system-setup/fedora/hyprland-kool-fed.sh new file mode 100644 index 00000000..dc11e670 --- /dev/null +++ b/core/tabs/system-setup/fedora/hyprland-kool-fed.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +git clone --depth=1 https://github.com/JaKooLit/Fedora-Hyprland.git ~/Fedora-Hyprland +cd ~/Fedora-Hyprland +chmod +x install.sh +./install.sh \ No newline at end of file diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 9f80eec0..4025068c 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -15,6 +15,13 @@ script = "arch/server-setup.sh" task_list = "SI D" multi_select = false +[[data.entries]] +name = "Hyprland Kool" +description = "This script is designed to handle the installation and configuration of Hyprland Kool" +script = "arch/hyprland-kool.sh" +task_list = "I MP" +multi_select = false + [[data.entries]] name ="Linux Neptune for SteamDeck" description = "Valve's fork of Linux Kernel for the SteamDeck" @@ -50,6 +57,20 @@ description = "Yet Another Yogurt - An AUR Helper Written in Go. To know more ab script = "arch/yay-setup.sh" task_list = "I" +[[data]] +name = "Debian" + +[[data.preconditions]] +matches = true +data = { file = "/etc/os-release", contains = "ID=debian" } +values = [] + +[[data.entries]] +name = "Hyprland Kool" +description = "This script is designed to handle the installation and configuration of Hyprland Kool" +script = "debian/hyprland-kool-deb.sh" +task_list = "I MP" + [[data]] name = "Fedora" @@ -64,6 +85,12 @@ description = "Optimizes DNF for parallel downloads" script = "fedora/configure-dnf.sh" task_list = "PFM" +[[data.entries]] +name = "Hyprland Kool" +description = "This script is designed to handle the installation and configuration of Hyprland Kool" +script = "fedora/hyprland-kool-fed.sh" +task_list = "I MP" + [[data.entries]] name = "Multimedia Codecs" description = "This script is designed to install multimedia codecs, and to ensure RPM Fusion repositories are installed." @@ -105,6 +132,25 @@ matches = true data = "command_exists" values = [ "btrfs" ] +[[data]] +name = "Ubuntu" + +[[data.preconditions]] +matches = true +data = { file = "/etc/os-release", contains = "ID=ubuntu" } +values = [] + +[[data.entries]] +name = "Hyprland Kool" +description = "This script is designed to handle the installation and configuration of Hyprland Kool" +script = "ubuntu/hyprland-kool-ubuntu24.sh" +task_list = "I MP" + +[[data.preconditions]] +matches = true +data = { file = "/etc/os-release", contains = 'VERSION_ID="24.04"' } +values = [] + [[data]] name = "Build Prerequisites" description = "This script is designed to handle the installation of various software dependencies across different Linux distributions" diff --git a/core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh b/core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh new file mode 100644 index 00000000..126d7ea3 --- /dev/null +++ b/core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Hyprland Kool" +git clone -b 24.04 --depth=1 https://github.com/JaKooLit/Ubuntu-Hyprland.git ~/Ubuntu-Hyprland-24.04 +cd ~/Ubuntu-Hyprland-24.04 +chmod +x install.sh +./install.sh \ No newline at end of file