Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow different os-releases and hyprland setup #1013

Merged
merged 26 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e009ef0
allow different os-releases and hypr setup
ChrisTitusTech Feb 2, 2025
4b72e84
Update core/src/inner.rs
ChrisTitusTech Feb 2, 2025
fc6acb2
Update core/tabs/system-setup/debian/hyprland-kool-deb.sh
ChrisTitusTech Feb 2, 2025
45d2995
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 2, 2025
b6bb227
Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh
ChrisTitusTech Feb 2, 2025
5391ade
Update core/tabs/system-setup/tab_data.toml
ChrisTitusTech Feb 2, 2025
63e0b82
Update core/tabs/system-setup/tab_data.toml
ChrisTitusTech Feb 2, 2025
b977560
Update core/tabs/system-setup/tab_data.toml
ChrisTitusTech Feb 2, 2025
f8900e4
Update core/tabs/system-setup/tab_data.toml
ChrisTitusTech Feb 2, 2025
a776682
Update core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh
ChrisTitusTech Feb 2, 2025
c173596
refactor: Improve File Contains precondition (#1016)
lj3954 Feb 4, 2025
d872d84
Update inner.rs (#1021)
ChrisTitusTech Feb 4, 2025
599ad20
Update inner.rs (#1022)
ChrisTitusTech Feb 4, 2025
9e34347
revert to liams commit
ChrisTitusTech Feb 4, 2025
b83cee7
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 5, 2025
d69c4e1
Update core/tabs/system-setup/debian/hyprland-kool-deb.sh
ChrisTitusTech Feb 5, 2025
5731a9b
Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh
ChrisTitusTech Feb 5, 2025
ad05a0d
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 5, 2025
7fa4d2d
Update core/tabs/system-setup/debian/hyprland-kool-deb.sh
ChrisTitusTech Feb 5, 2025
2b17c04
Update core/tabs/system-setup/debian/hyprland-kool-deb.sh
ChrisTitusTech Feb 5, 2025
f37778d
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 5, 2025
7ec3333
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 5, 2025
6e20e33
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 5, 2025
e5fdbff
Update core/tabs/system-setup/arch/hyprland-kool.sh
ChrisTitusTech Feb 5, 2025
072c08d
fix bashisms
ChrisTitusTech Feb 6, 2025
01535e2
Switch to SH from bash
ChrisTitusTech Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions core/src/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ fn default_true() -> bool {
}

#[derive(Deserialize)]
#[serde(rename_all = "snake_case")]
enum EntryType {
#[serde(rename = "entries")]
Entries(Vec<Entry>),
#[serde(rename = "command")]
Command(String),
#[serde(rename = "script")]
Script(PathBuf),
}

Expand All @@ -132,14 +130,16 @@ 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::ContainingFile(file) => std::fs::read_to_string(file)
.is_ok_and(|data| {
values
.iter()
.all(|matching| data.contains(matching) == *matches)
}),
SystemDataType::CommandExists => values
.iter()
.all(|command| which::which(command).is_ok() == *matches),
SystemDataType::FileExists => values.iter().all(|p| Path::new(p).is_file()),
}
},
)
Expand All @@ -157,12 +157,11 @@ struct Precondition {
}

#[derive(Deserialize)]
#[serde(rename_all = "snake_case")]
enum SystemDataType {
#[serde(rename = "environment")]
Environment(String),
#[serde(rename = "file")]
File(PathBuf),
#[serde(rename = "command_exists")]
ContainingFile(PathBuf),
FileExists,
CommandExists,
}

Expand Down
13 changes: 13 additions & 0 deletions core/tabs/system-setup/arch/hyprland-kool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
echo "Hyprland JaKooLit"
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved

if ! pacman -Q base-devel &>/dev/null; then
echo "Installing base-devel..."
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
sudo pacman -S --noconfirm base-devel
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
fi

git clone --depth=1 https://github.com/JaKooLit/Arch-Hyprland.git ~/Arch-Hyprland
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
cd ~/Arch-Hyprland

Check warning on line 11 in core/tabs/system-setup/arch/hyprland-kool.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Raw Output: ./core/tabs/system-setup/arch/hyprland-kool.sh:11:1: warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. (ShellCheck.SC2164)
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
chmod +x install.sh
./install.sh
7 changes: 7 additions & 0 deletions core/tabs/system-setup/debian/hyprland-kool-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
echo "Hyprland JaKooLit"
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
git clone --depth=1 https://github.com/JaKooLit/Debian-Hyprland.git ~/Debian-Hyprland
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if cloning fails? maybe due to a wifi problem, or the site could be having problems as seen a couple weeks ago where all git operations suddenly started erroring 404.

Adding error handling for this case would be for the best, since all other commands would also fail.

image

ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
cd ~/Debian-Hyprland

Check warning on line 5 in core/tabs/system-setup/debian/hyprland-kool-deb.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Raw Output: ./core/tabs/system-setup/debian/hyprland-kool-deb.sh:5:1: warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. (ShellCheck.SC2164)
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
chmod +x install.sh
./install.sh
8 changes: 8 additions & 0 deletions core/tabs/system-setup/fedora/hyprland-kool-fed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
echo "Hyprland JaKooLit"
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved

git clone --depth=1 https://github.com/JaKooLit/Fedora-Hyprland.git ~/Fedora-Hyprland
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
cd ~/Fedora-Hyprland

Check warning on line 6 in core/tabs/system-setup/fedora/hyprland-kool-fed.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Raw Output: ./core/tabs/system-setup/fedora/hyprland-kool-fed.sh:6:1: warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. (ShellCheck.SC2164)
ChrisTitusTech marked this conversation as resolved.
Show resolved Hide resolved
chmod +x install.sh
./install.sh
54 changes: 50 additions & 4 deletions core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ task_list = "SI D"
multi_select = false

[[data.entries]]
name ="Linux Neptune for SteamDeck"
name = "Hyprland JaKooLit"
description = "Install JaKooLit's Hyprland configuration"
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"
script = "arch/linux-neptune.sh"
task_list = "I PFM K"

[[data.entries.preconditions]]
matches = true
data = { file = "/sys/devices/virtual/dmi/id/board_vendor" }
values = [ "Valve" ]
data = { containing_file = "/sys/devices/virtual/dmi/id/board_vendor" }
values = ["Valve"]

[[data.entries]]
name = "Nvidia Drivers && Hardware Acceleration"
Expand All @@ -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 = { containing_file = "/etc/os-release" }
values = ["ID=debian"]

[[data.entries]]
name = "Hyprland JaKooLit"
description = "Install JaKooLit's Hyprland configuration"
script = "debian/hyprland-kool-deb.sh"
task_list = "I MP"

[[data]]
name = "Fedora"

Expand All @@ -64,6 +85,12 @@ description = "Optimizes DNF for parallel downloads"
script = "fedora/configure-dnf.sh"
task_list = "PFM"

[[data.entries]]
name = "Hyprland JaKooLit"
description = "Install JaKooLit's Hyprland configuration"
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."
Expand Down Expand Up @@ -103,7 +130,26 @@ task_list = "I PFM SS"
[[data.preconditions]]
matches = true
data = "command_exists"
values = [ "btrfs" ]
values = ["btrfs"]

[[data]]
name = "Ubuntu"

[[data.preconditions]]
matches = true
data = { containing_file = "/etc/os-release" }
values = ["ID=ubuntu"]

[[data.entries]]
name = "Hyprland JaKooLit"
description = "Install JaKooLit's Hyprland configuration"
script = "ubuntu/hyprland-kool-ubuntu24.sh"
task_list = "I MP"

[[data.preconditions]]
matches = true
data = { containing_file = "/etc/os-release" }
values = ['VERSION_ID="24.04"']

[[data]]
name = "Build Prerequisites"
Expand Down
8 changes: 8 additions & 0 deletions core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "Hyprland JaKooLit"

git clone -b 24.04 --depth=1 https://github.com/JaKooLit/Ubuntu-Hyprland.git ~/Ubuntu-Hyprland-24.04
cd ~/Ubuntu-Hyprland-24.04

Check warning on line 6 in core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Raw Output: ./core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh:6:1: warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. (ShellCheck.SC2164)
chmod +x install.sh
./install.sh
Loading