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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ChrisTitusTech
Copy link
Owner

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

Allows new type of tab data that can read files like /etc/os-release to add versioning preconditions for some scripts.

Also adds Hyprland setup script from @JaKooLit

Testing

Cargo run done on ubuntu 24 laptop and an arch linux desktop

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no errors/warnings/merge conflicts.

Copy link
Collaborator

@adamperkowski adamperkowski left a comment

Choose a reason for hiding this comment

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

i think it might be a better idea to make one script and use

case "$PACKAGER" in
# ...

but that's up to you

core/src/inner.rs Outdated Show resolved Hide resolved
core/tabs/system-setup/debian/hyprland-kool-deb.sh Outdated Show resolved Hide resolved
core/tabs/system-setup/arch/hyprland-kool.sh Outdated Show resolved Hide resolved
core/tabs/system-setup/tab_data.toml Outdated Show resolved Hide resolved
core/tabs/system-setup/tab_data.toml Outdated Show resolved Hide resolved
core/tabs/system-setup/tab_data.toml Outdated Show resolved Hide resolved
core/tabs/system-setup/tab_data.toml Outdated Show resolved Hide resolved
core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh Outdated Show resolved Hide resolved
@adamperkowski adamperkowski added enhancement New feature or request rust Pull requests that update Rust code refactor script Pull requests that update scripts labels Feb 2, 2025
Comment on lines +139 to +143
SystemDataType::FileContains { file, contains } => {
std::fs::read_to_string(file)
.map(|content| content.contains(contains) == *matches)
.unwrap_or(false)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this what the previous file precondition was doing? See linux neptune for example

Copy link
Owner Author

Choose a reason for hiding this comment

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

Let me test that out, for some odd reason I thought that was just matching the entire value of the file. It was late and I probably just missed this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it iterated through values[] and ensured each was contained within the file.

I feel as though the 'contains' in the FileContains variant also is redundant, given values[] already stores strings to validate.

I would personally keep the previous implementation of the File precondition (perhaps renaming it to FileContains) and create a new FileExists precondition, which would match the pattern with the existing CommandExists.

@JaKooLit
Copy link

JaKooLit commented Feb 2, 2025

Hi Chris.

Im glad you liked the setup :)

just for clarification, Ubuntu 24.04 hyprland installation is via source and latest Hyprland I could make it work is v0.39

24.10 and 25.04 (beta) have hyprland in their universe repo so can just install via apt

thats the reason why I set a different branch for different Ubuntu release.

so probably best that for Ubuntu, if release is the current 24.04 LTS, to pull from 24.04

@ChrisTitusTech
Copy link
Owner Author

i think it might be a better idea to make one script and use

case "$PACKAGER" in
# ...

but that's up to you

I need to differentiate between Ubuntu and Debian... Also some scripts can only be run on certain version... like ubuntu 22 vs ubuntu 24. This adds flexibility to those preconditions so it won't allow scripts to run on versions it won't be compatible with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor rust Pull requests that update Rust code script Pull requests that update scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants