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

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.

#!/bin/bash

echo "Hyprland JaKooLit"
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

core/tabs/system-setup/arch/hyprland-kool.sh Outdated Show resolved Hide resolved
core/tabs/system-setup/arch/hyprland-kool.sh Outdated Show resolved Hide resolved
core/tabs/system-setup/arch/hyprland-kool.sh Outdated Show resolved Hide resolved
core/tabs/system-setup/arch/hyprland-kool.sh Outdated Show resolved Hide resolved
core/tabs/system-setup/debian/hyprland-kool-deb.sh 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/fedora/hyprland-kool-fed.sh 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
@nnyyxxxx
Copy link
Contributor

nnyyxxxx commented Feb 4, 2025

i forgot to review the ubuntu script, just make similar changes there

@ChrisTitusTech ChrisTitusTech merged commit efa6ff9 into main Feb 6, 2025
6 checks passed
@ChrisTitusTech ChrisTitusTech deleted the hyprland-setup branch February 6, 2025 21:14
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
…11)

* allow different os-releases and hypr setup

* Update core/src/inner.rs



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh



* refactor: Improve File Contains precondition (ChrisTitusTech#1016)

* Update inner.rs (ChrisTitusTech#1021)

* Update inner.rs (ChrisTitusTech#1022)

* revert to liams commit

* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* fix bashisms

* Switch to SH from bash

---------

Co-authored-by: Chris Titus <[email protected]>
Co-authored-by: Adam Perkowski <[email protected]>
Co-authored-by: Liam <[email protected]>
Co-authored-by: nyx <[email protected]>
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
…12)

* allow different os-releases and hypr setup

* Update core/src/inner.rs



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh



* refactor: Improve File Contains precondition (ChrisTitusTech#1016)

* Update inner.rs (ChrisTitusTech#1021)

* Update inner.rs (ChrisTitusTech#1022)

* revert to liams commit

* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* fix bashisms

* Switch to SH from bash

---------

Co-authored-by: Chris Titus <[email protected]>
Co-authored-by: Adam Perkowski <[email protected]>
Co-authored-by: Liam <[email protected]>
Co-authored-by: nyx <[email protected]>
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
Jaredy899 added a commit to Jaredy899/linutil that referenced this pull request Feb 7, 2025
…15)

* allow different os-releases and hypr setup

* Update core/src/inner.rs



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/tab_data.toml



* Update core/tabs/system-setup/ubuntu/hyprland-kool-ubuntu24.sh



* refactor: Improve File Contains precondition (ChrisTitusTech#1016)

* Update inner.rs (ChrisTitusTech#1021)

* Update inner.rs (ChrisTitusTech#1022)

* revert to liams commit

* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/fedora/hyprland-kool-fed.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/debian/hyprland-kool-deb.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* Update core/tabs/system-setup/arch/hyprland-kool.sh



* fix bashisms

* Switch to SH from bash

---------

Co-authored-by: Chris Titus <[email protected]>
Co-authored-by: Adam Perkowski <[email protected]>
Co-authored-by: Liam <[email protected]>
Co-authored-by: nyx <[email protected]>
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.

6 participants