[BUG]: Custom layout column ordering #357

Closed
opened 2026-01-05 14:49:59 +01:00 by adam · 9 comments
Owner

Originally created by @tgrosinger on GitHub (Apr 28, 2024).

Describe the bug
If you place a primary column as the last column in a custom layout, komorebi fails to load.

For example, this custom layout will load:

[
  {
    "column": "Secondary",
    "configuration": {
      "Horizontal": 3
    }
  },
  {
    "column": "Primary"
  },
  {
    "column": "Tertiary",
    "configuration": "Horizontal"
  }
]

But if we change the ordering of the last two columns:

[
  {
    "column": "Secondary",
    "configuration": {
      "Horizontal": 3
    }
  },
  {
    "column": "Tertiary",
    "configuration": "Horizontal"
  },
  {
    "column": "Primary"

  }
]

It will no longer load.

PS C:\Users\tgrosinger> komorebi
2024-04-28T16:04:10.625234Z  INFO init: komorebi::window_manager: initialising
Error:
   0: the layout file provided was invalid

Location:
   D:\a\komorebi\komorebi\komorebi-core\src\custom_layout.rs:48

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: BaseThreadInitThunk<unknown>
      at <unknown source file>:<unknown line>
   2: RtlUserThreadStart<unknown>
      at <unknown source file>:<unknown line>

Operating System

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22631 Build 22631

komorebic check Output

PS C:\Users\tgrosinger> komorebi --version
komorebi 0.1.24

PS C:\Users\tgrosinger> komorebic check
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\tgrosinger

Looking for configuration files in C:\Users\tgrosinger

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\tgrosinger\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
Originally created by @tgrosinger on GitHub (Apr 28, 2024). **Describe the bug** If you place a primary column as the last column in a custom layout, komorebi fails to load. For example, this custom layout will load: ```json [ { "column": "Secondary", "configuration": { "Horizontal": 3 } }, { "column": "Primary" }, { "column": "Tertiary", "configuration": "Horizontal" } ] ``` But if we change the ordering of the last two columns: ``` [ { "column": "Secondary", "configuration": { "Horizontal": 3 } }, { "column": "Tertiary", "configuration": "Horizontal" }, { "column": "Primary" } ] ``` It will no longer load. ``` PS C:\Users\tgrosinger> komorebi 2024-04-28T16:04:10.625234Z INFO init: komorebi::window_manager: initialising Error: 0: the layout file provided was invalid Location: D:\a\komorebi\komorebi\komorebi-core\src\custom_layout.rs:48 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1: BaseThreadInitThunk<unknown> at <unknown source file>:<unknown line> 2: RtlUserThreadStart<unknown> at <unknown source file>:<unknown line> ``` **Operating System** ``` OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22631 Build 22631 ``` **`komorebic check` Output** ``` PS C:\Users\tgrosinger> komorebi --version komorebi 0.1.24 PS C:\Users\tgrosinger> komorebic check No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\tgrosinger Looking for configuration files in C:\Users\tgrosinger Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\tgrosinger\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag ```
adam added the bug label 2026-01-05 14:49:59 +01:00
adam closed this issue 2026-01-05 14:49:59 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Apr 28, 2024):

This is not a bug; this is part of the current design spec of custom layouts. Only a Tertiary column can occupy the rightmost position.

This feature doesn't really have an owner right now and honestly I regret implementing it. 😅

If anyone wants to work on a "Custom Layouts v2" with more flexibility in the design spec I am happy to mentor.

Some good places to start looking for anyone who is interested:

0b04e3ef93/komorebi-core/src/arrangement.rs (L198)

0b04e3ef93/komorebi-core/src/custom_layout.rs (L108)

@LGUG2Z commented on GitHub (Apr 28, 2024): This is not a bug; this is part of the current design spec of custom layouts. Only a Tertiary column can occupy the rightmost position. This feature doesn't really have an owner right now and honestly I regret implementing it. 😅 If anyone wants to work on a "Custom Layouts v2" with more flexibility in the design spec I am happy to mentor. Some good places to start looking for anyone who is interested: https://github.com/LGUG2Z/komorebi/blob/0b04e3ef93beace9ebe4e968c594b2c1dec72de8/komorebi-core/src/arrangement.rs#L198 https://github.com/LGUG2Z/komorebi/blob/0b04e3ef93beace9ebe4e968c594b2c1dec72de8/komorebi-core/src/custom_layout.rs#L108
Author
Owner

@tgrosinger commented on GitHub (Apr 28, 2024):

Here's the layout that I am actually trying to achieve. Is there another way I can accomplish this that would be valid?

[
  {
    "column": "Tertiary",
    "configuration": "Horizontal"
  },
  {
    "column": "Primary",
    "configuration": {
        "WidthPercentage": 75
    }
  }
]

I tried putting the primary column first and then swapping, but it seems that flip-layout horizontal does not work on custom layouts.

I also tried using the VerticalStack layout, but it enforces that the primary is 50% width and you can't resize it.

So many options that are so close, but haven't quite found one that gets me all the way there.

@tgrosinger commented on GitHub (Apr 28, 2024): Here's the layout that I am actually trying to achieve. Is there another way I can accomplish this that would be valid? ``` [ { "column": "Tertiary", "configuration": "Horizontal" }, { "column": "Primary", "configuration": { "WidthPercentage": 75 } } ] ``` I tried putting the primary column first and then swapping, but it seems that `flip-layout horizontal` does not work on custom layouts. I also tried using the `VerticalStack` layout, but it enforces that the primary is 50% width and you can't resize it. So many options that are so close, but haven't quite found one that gets me all the way there.
Author
Owner

@LGUG2Z commented on GitHub (Apr 28, 2024):

You can get close with VerticalStack flipped on the horizontal axis, but resize has not been implemented for this layout:

0b04e3ef93/komorebi/src/workspace.rs (L894)

This is also a good first issue to work on and you should be able to take some good inspiration from here:

0b04e3ef93/komorebi/src/workspace.rs (L930)

@LGUG2Z commented on GitHub (Apr 28, 2024): You can get close with `VerticalStack` flipped on the horizontal axis, but resize has not been implemented for this layout: https://github.com/LGUG2Z/komorebi/blob/0b04e3ef93beace9ebe4e968c594b2c1dec72de8/komorebi/src/workspace.rs#L894 This is also a good first issue to work on and you should be able to take some good inspiration from here: https://github.com/LGUG2Z/komorebi/blob/0b04e3ef93beace9ebe4e968c594b2c1dec72de8/komorebi/src/workspace.rs#L930
Author
Owner

@LGUG2Z commented on GitHub (Apr 28, 2024):

@tgrosinger I added a RightMainVerticalStack layout with resizing enabled here: 383533e2d9

+-----+-------+
|     |       |
+-----+       |
|     |       |
+-----+-------+
 stack   main
@LGUG2Z commented on GitHub (Apr 28, 2024): @tgrosinger I added a `RightMainVerticalStack` layout with resizing enabled here: https://github.com/LGUG2Z/komorebi/commit/383533e2d9a0cf1e893516311acd2cf4ce2f2dcc ``` +-----+-------+ | | | +-----+ | | | | +-----+-------+ stack main ```
Author
Owner

@tgrosinger commented on GitHub (Apr 28, 2024):

Exciting, thank you! I'll give it a try soon.

I'd love to help with adding some features to this project, but I don't have the bandwidth to start learning Rust at the moment. Maybe some day though :)

@tgrosinger commented on GitHub (Apr 28, 2024): Exciting, thank you! I'll give it a try soon. I'd love to help with adding some features to this project, but I don't have the bandwidth to start learning Rust at the moment. Maybe some day though :)
Author
Owner

@tgrosinger commented on GitHub (Apr 29, 2024):

This is perfect, thanks again.

@tgrosinger commented on GitHub (Apr 29, 2024): This is perfect, thanks again.
Author
Owner

@llinfeng commented on GitHub (Jul 10, 2024):

I was also looking for a RightMain-type of layout, and arrived at the same bug with the custom_layout config, where keeping "Primary" to the far-right is treated as an invalid layout.

For now, RightMainVerticalStack works great, as I can actually drag the main column and resize it as long as I don't move any other window around. When a window is moved to another monitor, the 50-50 split layout kicks back again.

Question: how to let the adjusted width for RightMainVerticalStack persist? Does the workspace setting (where I specify the "layout" key) take some additional argument to indicate how wide the Primary column should be? I tried to play with the resize_dimensions key, but didn't find a good way to load it properly.

@llinfeng commented on GitHub (Jul 10, 2024): I was also looking for a `RightMain`-type of layout, and arrived at the same bug with the `custom_layout` config, where keeping "Primary" to the far-right is treated as an invalid layout. For now, `RightMainVerticalStack` works great, as I can actually drag the main column and resize it _as long as I don't move any other window around_. When a window is moved to another monitor, the 50-50 split layout kicks back again. **Question**: how to let the adjusted width for `RightMainVerticalStack` persist? Does the workspace setting (where I specify the "layout" key) take some additional argument to indicate how wide the Primary column should be? I tried to play with the `resize_dimensions` key, but didn't find a good way to load it properly.
Author
Owner

@bilogic commented on GitHub (Aug 10, 2025):

@LGUG2Z

How do we configure a persistent unequal split with RightMainVerticalStack, e.g. 30-70?
It is a pain to resize it all the time and a real strain on the neck to have it turned slightly left or right constantly

@bilogic commented on GitHub (Aug 10, 2025): @LGUG2Z How do we configure a persistent unequal split with `RightMainVerticalStack`, e.g. 30-70? It is a pain to resize it all the time and a real strain on the neck to have it turned slightly left or right constantly
Author
Owner

@bilogic commented on GitHub (Aug 10, 2025):

@llinfeng @LGUG2Z

I found komorebic save-resize preferences.txt saves my split and komorebic load-resize preferences.txt loads it
I wished this gets loaded by default

@bilogic commented on GitHub (Aug 10, 2025): @llinfeng @LGUG2Z I found `komorebic save-resize preferences.txt` saves my split and `komorebic load-resize preferences.txt` loads it I wished this gets loaded by default
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#357