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

Question: is it possible to label windows? #152

Open
kalekundert opened this issue Oct 12, 2021 · 2 comments
Open

Question: is it possible to label windows? #152

kalekundert opened this issue Oct 12, 2021 · 2 comments

Comments

@kalekundert
Copy link
Contributor

For example, I'd like to have a hotkey that causes a window to take up half the screen. I'd also to detect when new monitors are connected, and then resize any windows that this hotkey was used on such that they take up half of the new screen size. I can use BERRY_WINDOW_STATUS to get the original size of a window, but it would be kinda of hard to work out from that what the new size should be.

I'm hoping that there's a way to attach arbitrary information to BERRY_WINDOW_STATUS, e.g. berryc label '{"position": "half right"}' or something like that. The idea would be to look up the "position" for each window, recalculate the coordinates for that position based on the new screen size, then apply those coordinates to the window. Is there any way to do something like this, either via berry or directly via X? If not, is this a feature you'd be open to adding?

@JLErvin
Copy link
Owner

JLErvin commented Oct 21, 2021

Unfortunately no, this isn't currently possible. I'd be open to adding something like this as I'm largely in favor of berry being extensible by developers. We could probably add some sort of berryc function that adds a property to BERRY_WINDOW_STATUS (like you pointed out) without too much work. I don't have much time or energy to work on berry these days, so I can't guarantee that I can get to this in any sort of timely manner. I'm more than willing to review/merge PRs that implement this, however.

@kalekundert
Copy link
Contributor Author

Ok, thanks for the reply. I probably won't get around to making a PR anytime in the near future, but it seems like a fun project, maybe I'll find some time for it eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants