oxwm github discord tonybtw.com

Scrolling layout

How it works

In the scrolling layout your windows sit side by side in one long horizontal strip. The screen shows a part of that strip, and the view slides to follow the focused window. Opening a window never shrinks the others. If you have used niri, this is the same idea.

Turn it on like any other layout:

oxwm.key.bind({ modkey }, "G", oxwm.layout.set("scrolling"))

Moving around

oxwm.key.bind({ modkey }, "Left", oxwm.layout.scroll_left())
oxwm.key.bind({ modkey }, "Right", oxwm.layout.scroll_right())

These focus the window to the left or right and slide the view to it. oxwm.client.focus_stack works here as well.

Window widths

Each window has its own width. A value of 1 or less is a share of the screen, and anything above 1 is a width in pixels. So 0.5 is half the screen and 800 is 800 pixels.

New windows open at half the screen. To change that:

oxwm.scroll.set_default_width(0.4)

Presets

You can step the focused window through a list of widths:

oxwm.scroll.set_width_presets({ 1 / 3, 1 / 2, 2 / 3 })

oxwm.key.bind({ modkey }, "R", oxwm.layout.cycle_width(1))
oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.layout.cycle_width(-1))

cycle_width(1) goes to the next preset and cycle_width(-1) to the previous one. The list can hold up to 8 widths, and the one above is the default.

Setting a width

To jump straight to a width:

oxwm.key.bind({ modkey }, "M", oxwm.layout.set_width(1))

That makes the focused window fill the screen.

Resizing

oxwm.set_master_factor resizes the focused window in this layout, so the keys you use for the master area in tiling keep doing something useful:

oxwm.key.bind({ modkey }, "H", oxwm.set_master_factor(-50))
oxwm.key.bind({ modkey }, "L", oxwm.set_master_factor(50))

Per application

A window rule can give an application a starting width:

oxwm.rule.add({ class = "firefox", width = 0.66 })

Minimap

While a tag is in the scrolling layout, the bar shows a small map of the strip next to the layout symbol. There is one box per window, and the focused one is highlighted.

oxwm.scroll.set_indicator(true)
oxwm.scroll.set_indicator_width(120)

The width is in pixels. 0 is the default and means four times the bar height. Pass false to set_indicator to turn the map off.

Touchpad gestures

A three finger swipe scrolls the strip and snaps to the nearest window when you let go. Gestures are off until you ask for them:

oxwm.scroll.set_gesture_enabled(true)
Function Default Meaning
set_gesture_fingers(n) 3 Fingers needed for a swipe: 3, 4 or 5
set_gesture_speed(x) 2.0 How far the view moves for each unit of finger travel
set_gesture_natural(enabled) false Flip the direction so windows follow your fingers

Two things have to be true for gestures to work:

Gestures are not available on BSD.