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

Add the ability to combine Querys into composite Queries #294

Closed
1 of 6 tasks
favilo opened this issue Apr 15, 2024 · 4 comments
Closed
1 of 6 tasks

Add the ability to combine Querys into composite Queries #294

favilo opened this issue Apr 15, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@favilo
Copy link
Contributor

favilo commented Apr 15, 2024

Please describe the change / addition you'd like to see made

I'd like to see an ergonomic interface that allows me to combine Query structs in simple ways.

Specifically I'd like to write something like the following:

    let manage_hook = manage_hooks! {
		ClassName("zoom").and(
            Titles(ZOOM_TILE_TITLES.to_vec()))
        => DefaultTiled,
        ClassName("zoom").and(
            Titles(ZOOM_TILE_TITLES.to_vec()).not()
        ) => FloatingRelative(top_right_corner),
        ClassName("obsidian").and(
            Titles(vec!["Obsidian Help"]))
         => FloatingCentered::new(0.25, 0.5),
	}

And have it work in the generally expected way.

  • Is this completely new functionality, or an enhancement to existing functionality?

This is just an enhancement to what already exists.

  • What kind of feature is it that you are requesting?
    • Changes to core
    • A new layout
    • A hook implementation
    • A custom extension
    • New X interactions
    • Other

Is this a feature you have seen in other window managers?

If so, please provide any links or reference to the existing implementation
and some details on how the feature is used.

Yes, I've used these types of Queries with XMonad.

I'm extending my own personal penrose config based on this article: https://www.peterstuart.org/posts/2021-09-06-xmonad-zoom/.

@favilo favilo added the enhancement New feature or request label Apr 15, 2024
@favilo
Copy link
Contributor Author

favilo commented Apr 15, 2024

I've submitted #291, as a first stab at this.

@favilo favilo changed the title Add the ability to have composite Query structs for combining them Add the ability to combine Querys into composite Queries Apr 15, 2024
@sminez
Copy link
Owner

sminez commented Jun 2, 2024

Hi @favilo, I'm not sure if you saw the comments I left on your PR? Taking a quick look at your config it looks like the class name check can just be made part of the custom Titles query that you've already set up? While I do like the idea of being able to compose together hooks in this way, there are a couple of issues with what you have provided in the PR. If this is still a feature that you'd like to see added to Penrose then please do let me know if what I've commented on the PR is all making sense. If not then I'll close this as won't fix until there is someone who is wanting to actively make use of this as a feature so I can be sure that the implementation satisfies their use case 🙂

@favilo
Copy link
Contributor Author

favilo commented Jun 6, 2024

Ah, sorry, I've been rather busy this last month, so I haven't had time to work on the PR, but yes, I saw the comments.

I would really like the ability to combine the Queries, and I think your suggestions are valid. Give me a few days, and I'll hopefully find some time to tidy up the PR.

@sminez
Copy link
Owner

sminez commented Jun 19, 2024

Implemented in #291

@sminez sminez closed this as completed Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants