Skip to content

allow different os-releases and hyprland setup#1013

Merged
ChrisTitusTech merged 26 commits intomainfrom
hyprland-setup
Feb 6, 2025
Merged

allow different os-releases and hyprland setup#1013
ChrisTitusTech merged 26 commits intomainfrom
hyprland-setup

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

@koibtw koibtw 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

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 and others added 9 commits February 2, 2025 12:19
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
@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.

@ChrisTitusTech ChrisTitusTech requested a review from koibtw February 4, 2025 19:05
#!/bin/bash

echo "Hyprland JaKooLit"
git clone --depth=1 https://github.com/JaKooLit/Debian-Hyprland.git ~/Debian-Hyprland
Copy link

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

@ghost
Copy link

ghost commented Feb 4, 2025

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

ChrisTitusTech and others added 3 commits February 5, 2025 11:07
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
ChrisTitusTech and others added 8 commits February 5, 2025 11:07
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants