setlayout - bakkeby/dusk GitHub Wiki
Function | Expected argument | Default keybinding |
---|---|---|
setlayout | int, e.g. 0 or 5
|
Super+space (toggles previous layout) |
setlayout
is an internal function that is used to set a layout for a workspace.
Note that contrary to dwm there are no default keybindings for setting specific layouts, but you can add these yourself should you need them.
Example keybindings to set specific layouts:
{ KeyPress, MODKEY, XK_, setlayout, {0} }, // sets tile layout
{ KeyPress, MODKEY, XK_, setlayout, {3} }, // sets monocle layout
{ KeyPress, MODKEY, XK_, setlayout, {-1} }, // toggles between current and previous layout
Passing an integer that is larger than the number of layouts will result in a no-op.
Refer to the layouts[]
array in config.h for layout options.
Tip: When using runtime configuration the layout name can be passed as the argument, making for more readable configuration and avoids mismatch if the layout indices change.
{ modifier = "Alt", key = "t", function = "setlayout", argument = "tile" }, # tile layout
{ modifier = "Alt", key = "f", function = "setlayout", argument = "floating" }, # floating layout
{ modifier = "Alt", key = "m", function = "setlayout", argument = "monocle" }, # monocle layout
External commands:
$ duskc run_command setlayout 3 # change to monocle layout