Files
komorebi/docs/usage/scrolling-layout.md
T
LGUG2Z ebc9d49d77 feat(scrolling): make room for windows that will not get as narrow
Many apps will not make a window narrower than some width. The layout
placed the next column as if the window had the width it was given, and
so placed it on top of the window that had not.

What the arrival module has been told, the layout picks up at the start
of the next pass: a column is never narrower than the window in it
needs, plus the padding and border around it and capped at the width of
the screen, and the columns after it are placed where it ends. A limit
only ever goes up, so that a column does not bounce between two widths,
and a stack takes the widest of its windows.

With animations off the layout asks every window that it resized what
it is, with a timeout, and places everything once more if one refused.
With animations on the animator says so when a journey ends, so a
window that refuses is noticed then as well.
2026-10-29 16:38:53 -07:00

6.0 KiB

The Scrolling Layout

In the Scrolling layout every window is a column in a row that is as long as it needs to be, and the screen is a viewport onto a part of it. A new window is added to the right of the focused one. Nothing is squeezed to make it fit: the row gets longer, and the screen scrolls to follow your focus.

{
  "monitors": [
    {
      "workspaces": [
        {
          "name": "I",
          "layout": "Scrolling",
          "layout_options": {
            "scrolling": {
              "columns": 3,
              "center_focused_column": "Never"
            }
          }
        }
      ]
    }
  ]
}

Column widths

columns says how many columns fit across the screen, which is to say that a new column is a columnsth of the screen wide. It is 3 unless you say otherwise. It does not say how many windows there are: a lone window is a third of the screen wide, and is not stretched to fill it.

  • Opening or closing a window never changes the width of another window.
  • A column that you have resized keeps its width as windows come and go.
  • Columns that you have not resized follow columns. Changing it with komorebic scrolling-layout-columns, or crossing the threshold of a layout_options_rules entry, lays them out again.

Centring the focused column

center_focused_column says when the focused column is put in the middle of the screen. It is one of:

  • "Never", the default, which scrolls only as far as it has to.
  • "Always", which keeps the focused column in the middle of the screen.
  • "OnOverflow", which centres it when it does not fit on the screen together with the column that focus came from.

true and false are also accepted, as they were before there were three choices: true is "Always" and false is "Never". Like columns, it is set for a workspace, or for a layout_options_rules entry.

A lone window is a third of the screen wide, at the left edge. To have it fill the screen, or to take it out of the layout for a while, use komorebic toggle-monocle.

Full width and centring

  • komorebic scrolling-layout-full-width makes the focused column as wide as the screen, or puts it back to the width that it had.
  • komorebic center-focus scrolls the screen so that the focused column is in the middle of it, once. center_focused_column does it every time that focus moves instead.
  • komorebic expand makes the focused column as wide as it can be without moving another column out of view: it takes up the room that the columns on the screen leave. It does nothing when there is none, and in the other layouts. With center_focused_column set to "Always" it makes the column the full width of the screen, or puts it back, as scrolling-layout-full-width does.

A column that you make the full width of the screen takes the gaps into account, so that it fills the screen exactly. Nothing else moves to make room for a column that gets wider: the focused column keeps its left edge, and the screen scrolls only if the column no longer fits.

Scrolling

The row scrolls only when it has to.

  • Focusing a window that is already on screen does not move anything.
  • Focusing one that is not scrolls just far enough to bring it in, and no further.
  • A window that is wider than the screen starts at the left edge.
  • The focused window does not move when windows to its left open, close or change width.

When you close a window, focus goes back to the window that it was opened next to if you have not moved focus since, and the screen scrolls back to where it was. If you have, focus goes to the window that takes the closed window's place on the right, or to the one before it if there is none. A window that is closed without having focus does not take focus with it.

Resizing

komorebic resize-edge and komorebic resize-axis change the width of the focused column, by half of the resize delta for each edge, so resizing the horizontal axis changes the width by the whole delta. Dragging an edge with the mouse does the same. Columns are as tall as the screen, so resizing a height does nothing.

komorebic retile puts every column back to the width that scrolling-layout-columns gives, on the focused workspace of each monitor. The focused column stays where it is on screen, unless it has to scroll to stay in view.

Windows with a minimum width

Many apps will not make a window narrower than some width, whatever they are asked. komorebi asks a window how wide it is once it has been resized, and if it did not get as narrow as its column, the column becomes as wide as the window needs. With animations on that is when the window arrives, and with them off it is straight after the resize. The columns after it move along to make room, and nothing overlaps. A column never gets narrower again because of this, and never gets wider than the screen.

Windows that are out of view

A window that scrolls out of view comes to rest at the edge of the screen that it left by, with 5 pixels of it still on screen. It keeps its size, so nothing has to be resized to bring it back. With animations on, it slides there.

A window that is partly in view keeps its size too, and overhangs the edge of the screen.

macOS shows a window on whichever display it overlaps. If another display is next to an edge, a window that rests there or overhangs it would be seen on that display. In that case a window that has scrolled out of view is hidden in a corner of the screen instead, and a window that is partly in view is made narrower to fit on the screen. If your displays are arranged above and below each other rather than side by side, none of this applies.

Limits

These are not done yet.

  • Every window has a border, including the windows resting at the edges, so you may see a thin line of one at the edge of the screen.