Change the workspace layout via the niri ipc api #708
Replies: 2 comments 1 reply
-
Hey, I don't want to expose the layout tree because it's hard to future proof the data structures. I am planning however to add more properties to windows, like their positions on the workspace, sizes, etc. |
Beta Was this translation helpful? Give feedback.
-
Hm, good point, the layout tree is indeed hard to future proof. I figure there would be a bunch of endpoints needed to manipulate the Layout via the IPC. Would be worth it tho, it really would be awesome tho have some way to automate workspace. Currently I open the required applications via a script but the stacking and resizing need to be done by hand. It is OK, but it is always the same 🙈 |
Beta Was this translation helpful? Give feedback.
-
Hi everybody.
Have you ever considered to set the layout of a workspace via the ipc api?
I think about something like getting the layout tree via the niri msg with the window ids, titles, app_ids... in the structure of columns with the containing Windows and there height/preset, with preserved ordering the way it is currently on the workspace.
Some external application could use this feature to perform a reordering/resizing of the windows and calls niri msg with the reordered/resized layout representation.
Niri then would try to change the window locations and sizes if possible(returns error if values out of bounds, or windows missing/duplicated).
I would use it to automate workspace layouts I frequently use. e.g. work-spaces with only the messaging stuff, or work-spaces for multimedia, frequently used projects etc...
I am not sure if this could be emulated using the current niri ipc api.
Beta Was this translation helpful? Give feedback.
All reactions