-
-
Notifications
You must be signed in to change notification settings - Fork 962
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
Save restore dwindle layout #9054
base: main
Are you sure you want to change the base?
Conversation
…r and allows for returning a response
How would this be used, exactly? |
Personally, I like to have my windows in a specific arrangement when I'm working, and I hate having to remake the layout every time, so that's how I would use it. |
It's not entirely clear to me how restoring is supposed to work with this? There's some utility to making this generic (i.e a matching 'restore your state from this dump you provided earlier' dispatcher). Being able to do stuff like gather all windows on a workspace into a tabbed group and then 'release' them back into the layout with the same exact positioning as before would be one use for a generic save/restore. Unfortunately I don't think there's a good way to do this without requiring every layout to contain a json parser.... |
that would be understandable but I am asking in this MR, specifically, cuz I fail to see it |
Let's say I have a workspace where I keep all of my open chat/communication clients (discord, steam, email, etc). And I have them laid out in my own preferred way (discord always on top of steam chat in a vertical split or something). Now say I want to temporarily focus on one of these clients in another workspace which I am currently focusing. This can easily be done with something like But then when I am done with the window I want to send it back to where I want it inside of my chat workspace (on top of steam). Currently there is no way to do this but with hyprctl dispatch --batch 'layoutmsg preselect t ; layoutmsg opennexton . address:<steam chat window address> ; movetoworkspacesilent name:Chat, address:<discord window address>' If we also add I thought that together with Which is why I added the
The idea is that the layouts would not have to be responsible for saving or restoring anything. Merely to have a way to be queried for layout specific state information. It would be up to the users or tool authors to make use of this information if they want to restore a session. I'm also not advocating for this to be a requirement either. Merely for layout authors to have the option to implement custom queries the same ways they have a proper way to implement dispatch commands via |
Describe your PR, what does it fix/add?
To make it possible to save and restore dwindle workspace layouts via hyprctl.
To be able to "restore" layouts it adds an
"opennexton"
layoutmsg handler for the dwindle layout. It works like"preselect"
but with a dwindle node instead."Saving" layouts is done with
hyprctl layoutdata workspaceinfo <workspace_id>
.The hyprctl cmd (
"layoutdata"
) which kind of does the same thing as"dispatch layoutmsg"
but allows the layout to send a response.workspaceinfo
is then a handler implemented for the dwindle layout.Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Some points which need to be discussed:
opennexton
layoutmsg handler may not be particularly intuitive. I think there should be a way to target nodes which contain more than one window. And targeting the root is really useful if you want to do something like "maximize to half the screen". But it may be better to just leave out that functionality for now."setnodesplitratio"
layoutmsg handler is also needed if you want to restore the window sizes of the layout. I thoughtdispatch splitratio
could be used it does not take a window argument. And even if it did there would be no way to target nodes which are not single windows.Is it ready for merging, or does it need work?
NO, the questions above need to be addressed first. But aside from that there is also the documentation and stuff like tab completions for hyprctl.