Skip to content

layout_center

fdev31 edited this page Jan 30, 2024 · 14 revisions

Implements a workspace layout where one window is bigger and centered, other windows are tiled as usual in the background.

On toggle, the active window is made floating and centered if the layout wasn't enabled, else reverts the floating status.

With next and prev you can cycle the active window, keeping the same layout type. If the layout_center isn't active and next or prev is used, it will change the focus in the "right" or "left" direction. This allows keeping the same keyboard binding to change the focus regardless of the status of this layout. If you prefer a vertical ("up" and "down") focus override, enable the vertical configuration option (described below).

Sample usage in hyprland.conf:

bind = $mainMod, M, exec, pypr layout_center toggle # toggle the layout
bind = $mainMod, left, exec, pypr layout_center prev # move focus left
bind = $mainMod, right, exec, pypr layout_center next # move focus right
bind = $mainMod, up, movefocus, u # move focus up
bind = $mainMod, down, movefocus, d # move focus down

Note

Added in version 1.8.0

Command

  • layout_center [command] where [command] can be:
    • next
    • prev
    • toggle

Configuration

margin (optional)

margin (in pixels) used when placing the center window, calculated from the border of the screen.

offset (optional)

offset in pixels applied after the window position & size are computed regarding margin.

vertical (optional)

If the layout_center isn't active, trigger focus "up" or "down" instead of "left" and "right".

Clone this wiki locally