X11::ko...::Layout(3)

πŸ“¦ version 5.0, in alpine 3.24

πŸ¦‹ X11::ko...::Layout πŸ¦‹

okay bestie, so this is X11::ko...::Layout(3), a User Contributed Perl Documentation page, and it's lowkey about one of the most satisfying things ever: putting windows in their proper order. Let's get into it πŸ’…


πŸ’– DESCRIPTION πŸ’–

The whole idea behind this module is, like, arranging windows in a proper order ✨ There's a kind of "default" layout for any tag, right? And every single time a user starts using a tag (meaning they create the first window on it), the layout for that tag gets copied from the default one over to a "working" one. Iconic. Then the user can either close all the windows on that tag β€” which means that working layout gets disposed of β€” or they can change the layout sizes in several different ways. Their choice, main character energy πŸŽ€

The working layout depends on the number of tiled windows in it: like, the layout for a single window is genuinely different from the layout for a whole bunch of them. No cap.

So based on the number of windows, we need to get a "layout object", which could either be altered in edge sizes, or handle a list of windows, configuring them one by one to match the selected scheme 🫢

Layout relies on grid division of the screen. First it divides the screen into a number of rows, and then into columns. The "default" layout for 5 windows looks like this:

{
    'cols' => [
        '0.5',
        '0.5'
    ],
    'ncols' => 2,
    'nrows' => 3,
    'rows' => [
        '0.333333333333333',
        '0.333333333333333',
        '0.333333333333333'
    ]
};

Then it's being translated into a grid, where the first element of each array is the column's weight, and the other elements are the row weights inside that column 🌸 So for 5 windows the grid will look like:

[
    [
        '0.5',
        '0.5',
        '0.5'
    ],
    [
        '0.5',
        '0.333333333333333',
        '0.333333333333333',
        '0.333333333333333'
    ]
];

And the user maybe will be able to change weights in their local copy of the grid, and everything will work in the same way πŸ’€ (yes, "maybe" β€” that's the actual vibe of the original, we're not gonna pretend it's a promise πŸ™ˆ)


okay that's literally the whole page, short and sweet, ate and left no crumbs πŸ’œ

✿ sign-off time ✿ this iconic little doc is from perl v5.42.2, dated 2026-02-15, and it's the X11::ko...::Layout(3) page πŸ§šπŸ’– go forth and tile those windows, bestie πŸ¦‹

πŸ“¦ where this page comes from