b3nj5m1n / pfui

Efficiently generate content for statusbars, especially eww
MIT License
5 stars 1 forks source link

feat: hyprland module #1

Closed hardfau1t closed 1 year ago

hardfau1t commented 1 year ago

Few things

b3nj5m1n commented 1 year ago

This is very cool, unfortunately I'm getting an error when I try to build this:

error[E0599]: `Workspaces` is not an iterator
   --> src/modules/hyprland.rs:38:30
    |
38  |   ...                   .into_iter()
    |                          ^^^^^^^^^ `Workspaces` is not an iterator
    |
   ::: /home/b3nj4m1n/.local/share/cargo/git/checkouts/hyprland-rs-ce7ad3b93f8820bb/9c92cd0/src/data/regular.rs:209:1
    |
209 | / create_data_struct!(
210 | |     vec Workspaces,
211 | |     DataCommands::Workspaces,
212 | |     Workspace,
213 | |     "This type provides a vector of workspaces"
214 | | );
    | | -
    | | |
    | |_doesn't satisfy `Workspaces: IntoIterator`
    |   doesn't satisfy `Workspaces: std::iter::Iterator`
    |
    = note: the following trait bounds were not satisfied:
            `Workspaces: std::iter::Iterator`
            which is required by `Workspaces: IntoIterator`
            `&Workspaces: std::iter::Iterator`
            which is required by `&Workspaces: IntoIterator`
            `&mut Workspaces: std::iter::Iterator`
            which is required by `&mut Workspaces: IntoIterator`

error[E0609]: no field `data` on type `&_`
  --> src/modules/hyprland.rs:45:67
   |
45 |                         wspaces.sort_by_key(|wspace| match wspace.data.id {
   |                                                                   ^^^^

Some errors have detailed explanations: E0599, E0609.
For more information about an error, try `rustc --explain E0599`.

I just added a bit of CI to this project in adfcd51907a3ddc5be7d74f3eab9895de83e14dc, so it'd be great if you could update your branch to include that commit, since I think that's required to run the GitHub action on this PR.

Once you do that, we'll know if this is an issue on my end or if there's actually a problem with the code.


later will add logging

My plan was to add tracing eventually.


Unfortunately, I haven't gotten around to trying out hyprland yet because I (sadly) have an nvidia card, so I'll have to figure out some way to actually test this PR once I get it to build, and I'm not sure when I'll be able to do that, just as a heads-up.

hardfau1t commented 1 year ago

we'll know if this is an issue on my end or if there's actually a problem with the code.

it was an issue, I had all the commits in a single branch and while separating them i missed this,

b3nj5m1n commented 1 year ago

Unfortunately I haven't been able to properly test this myself yet since I haven't got around to setting up hyprland, but since this won't be included in a release immediately, I'll go ahead and merge it.

Thanks again for your work on this.