Save window size #36

Closed
opened 2026-01-05 14:47:50 +01:00 by adam · 3 comments
Owner

Originally created by @yydcnjjw on GitHub (Sep 21, 2021).

Originally assigned to: @LGUG2Z on GitHub.

The window size is reset when the minimized window is restored.

Originally created by @yydcnjjw on GitHub (Sep 21, 2021). Originally assigned to: @LGUG2Z on GitHub. The window size is reset when the minimized window is restored.
adam added the enhancement label 2026-01-05 14:47:50 +01:00
adam closed this issue 2026-01-05 14:47:50 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Sep 21, 2021):

This is intended behaviour as komorebi only manages visible windows, and explicitly unmanages windows on minimization.

However, I think it should be possible to add commands to quickly save and restore resized layouts per-workspace. I will take a look into how this might be implemented and report back in this issue.

@LGUG2Z commented on GitHub (Sep 21, 2021): This is intended behaviour as `komorebi` only manages visible windows, and explicitly unmanages windows on minimization. However, I think it should be possible to add commands to quickly save and restore resized layouts per-workspace. I will take a look into how this might be implemented and report back in this issue.
Author
Owner

@LGUG2Z commented on GitHub (Sep 22, 2021):

cQvETsgh9Y

80bcb51f75 adds two new komorebic commands to quicksave and quickload BSP layouts with custom resize dimensions. The quicksave file is stored at ${Env:TEMP}/komorebi.quicksave.json, and is a Vec<Option<Rect>> serialized to JSON.

If a user tries to quickload without a quicksave file being present, an error will be logged.

At this point there is only one quicksave file which will always be overwritten whenever the quicksave command is called. Both commands will only operate on the focused workspace of the focused monitor.

This means that you can quicksave a layout on one workspace, and then quickload it onto multiple other workspaces (individually) on the same or other monitors.

If the number of elements in the deserialized Vec is greater than the number of containers on a workspace, the Vec will be truncated when Workspace.update is run, and similarly if the number of elements is less than the number of containers on a workspace, the Vec will be extended by the difference using None values.

@LGUG2Z commented on GitHub (Sep 22, 2021): ![cQvETsgh9Y](https://user-images.githubusercontent.com/13164844/134264158-4008e046-3ea1-43c4-bf88-377dc83adc3b.gif) https://github.com/LGUG2Z/komorebi/commit/80bcb51f7508c08b6e7bcae4cf4aa35ac3db61cc adds two new komorebic commands to quicksave and quickload BSP layouts with custom resize dimensions. The quicksave file is stored at `${Env:TEMP}/komorebi.quicksave.json`, and is a `Vec<Option<Rect>>` serialized to JSON. If a user tries to quickload without a quicksave file being present, an error will be logged. At this point there is only one quicksave file which will always be overwritten whenever the quicksave command is called. Both commands will only operate on the focused workspace of the focused monitor. This means that you can quicksave a layout on one workspace, and then quickload it onto multiple other workspaces (individually) on the same or other monitors. If the number of elements in the deserialized `Vec` is greater than the number of containers on a workspace, the `Vec` will be truncated when `Workspace.update` is run, and similarly if the number of elements is less than the number of containers on a workspace, the `Vec` will be extended by the difference using None values.
Author
Owner

@greghart commented on GitHub (Jun 11, 2025):

Thanks so much for this! These commands provided exactly what I needed.

For anyone else like me googling their way here (there seemed to be a discussion @ https://github.com/LGUG2Z/komorebi/discussions/957 but it's 404ing now), and wondering how to get workspace specific sizes saved (eg. resize workspace 1 and 2 distinctly), you can use the query focused-workspace-index command with save-resize to save workspace specific sizes, like so:

komorebic save-resize "$Env:USERPROFILE\\komorebi_layouts\\$(komorebic query focused-workspace-index).json"
komorebic load-resize "$Env:USERPROFILE\\komorebi_layouts\\$(komorebic query focused-workspace-index).json"
@greghart commented on GitHub (Jun 11, 2025): Thanks so much for this! These commands provided exactly what I needed. For anyone else like me googling their way here (there seemed to be a discussion @ https://github.com/LGUG2Z/komorebi/discussions/957 but it's 404ing now), and wondering how to get workspace specific sizes saved (eg. resize workspace 1 and 2 distinctly), you can use the `query focused-workspace-index` command with `save-resize` to save workspace specific sizes, like so: ``` komorebic save-resize "$Env:USERPROFILE\\komorebi_layouts\\$(komorebic query focused-workspace-index).json" komorebic load-resize "$Env:USERPROFILE\\komorebi_layouts\\$(komorebic query focused-workspace-index).json" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#36