berry
berry copied to clipboard
Question: is it possible to label windows?
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?
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.
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.