Runtime Configuration - bakkeby/dusk GitHub Wiki

This page outlines the runtime configuration, as in configuration changes that you can make without having to recompile dusk. These changes come into effect the next time you start, or restart, dusk.

For compile-time configuration options located in in config.h refer to the Configuration page instead.

The default runtime configuration file dusk.cfg is located in the project directory and should be placed in either ~/.config/dusk/ or $XDG_CONFIG_HOME/dusk/. The file is intentionally not copied during installation (some people may not want it).

In practice you should be able to configure almost everything in dusk through runtime configuration. Settings in relation to Xresource strings have been omitted as it does not make much sense loading settings via Xresources in addition to having runtime configuration.

As such dmenu command configuration (font, colors) have been omitted from the runtime configuration as this is expected to be controlled using Xresources anyway if needed.

In general if anything is omitted / removed from the runtime configuration then the corresponding settings should fall back to whatever is defined in the default configuration.

NB: For syntax highlighting you may try Ruby, awk, cucumber, perl, puppet or R depending on your preferences.

borderpx

borderpx = 5;  # border pixel of windows

The border pixel determines the size of the coloured border around client windows. This will also affect the size of the bar border if the functionality is enabled.

Also refer to the setborderpx function.

snap

snap = 32;     # snap pixel

The snap value determines how far (in pixels) the mouse cursor have to move when moving or resizing a tiled window before it snaps out of tiled and becomes floating.

The value is also used when moving a window using the mouse where if the window border is less than snap pixels away from the monitor window area, which is the screen real estate less the space used by the bars, then the window will snap to that edge.

Refer to the movemouse and resizemouse functions.

mfact

mfact = 0.50;  # factor of master area size [0.05..0.95]

The mfact (master area factor) value controls the size of the master area compared to the stack area in most layouts.

The value is restricted to be between 0.05 to 0.95 (5% to 95%) of the workspace area.

The default value here is used when the workspace rules has an mfact value of -1.

Refer to the setmfact and dragmfact functions.

nmaster

nmaster = 1;   # number of clients in master area

The nmaster (number of master) value determines the number of clients that are to be placed in the master area of most layouts.

The default value here is used when the workspace rules has an nmaster value of -1.

Refer to the incnmaster function.

nstack

nstack = 0;    # number of clients in primary stack area

The nstack (number of stack) value determines the number of clients in the primary stack area for dual stack layouts.

The default value here is used when the workspace rules has an nstack value of -1.

Refer to the incnstack function.

fonts

fonts = [ "monospace:size=10" ];

The fonts config is a list of font names that the window manager will use for displaying text on the bar.

The first in the list will be the primary font while the rest will be fallback fonts that are used should the primary font does not have a specific glyph (character).

The font names can generally be found by using the fc-list command in a terminal.

Keep in mind that not all fonts are created equally. When combining different fonts they may have to be set to different sizes to appear roughly the same.

If text size is significantly different to the size of symbols then you can try setting pixelsize instead of size in the font string.

Refer to the ColorEmoji functionality if you plan to enable coloured emoji in the bar.

Refer to the fontconfig page for details when it comes to system configuration:

attach method

attach_method = "AttachAside";

The attach_method setting controls where in the client stack a new window will appear by default.

Refer to Attach and the setattachdefault function.

commands

commands = (
  { name = "termcmd", command = [ "st" ] },
  { name = "dmenucmd", command = [ "dmenu_run" ] },
  { name = "spcmd_w", scratchkey = "w", command = [ "st", "-n", "spterm (w)", "-g", "120x34" ] },
  { name = "spcmd_e", scratchkey = "e", command = [ "st", "-n", "spterm (e)", "-g", "120x34" ] },
  { name = "spcmd_r", scratchkey = "r", command = [ "st", "-n", "spfm (r)", "-g", "120x34", "-e", "ranger" ] },
  { name = "statusclickcmd", command = [ "~/bin/statusbar/statusclick.sh" ] },
)

The above setting contains a list of named commands.

These names are used later when configuring keybindings as well as autostart commands. The commands are in execv format which means separate strings for each parameter. For example "st", "-n", "name" rather than "st -n name".

Scratchpad commands also specify a scratch key that is used to identify clients via client rules. Note that scratch keys should be a single character only. Note that the predefined scratchpad commands and associated rules and keybindings are merely examples to show how scratchpads can be set up. Refer to the Scratchpads topic for further details.

Button clicks that fall on top of statuses on the bar are forwarded to an external script defined by the statusclickcmd command. Refer to the statusclick function for more information on this.

If statusclickcmd, termcmd, or dmenucmd are missing from the commands list then they will fall back to whatever is defined in the compile-time config.

autostart

autostart = [ "termcmd" ];

autorestart = [ ];

The autostart array is a list of programs that are to start automatically alongside the window manager when it initially starts. The autorestart array are specifically for commands that are to be executed following a restart of the window manager.

The list is expected to contain strings that refer to the predefined commands in #commands

Refer to the autostart feature.

gap sizes

gaps:
{
  ih = 5;  # horiz inner gap between windows
  iv = 5;  # vert inner gap between windows
  oh = 5;  # horiz outer gap between windows and screen edge
  ov = 5;  # vert outer gap between windows and screen edge
  fl = 5;  # gap between floating windows (when relevant)
  enabled = true;  # whether gaps are enabled by default or not
  # smartgaps factor when there is only one client
  smartgaps_fact = 0;  # 0 = no gaps, 3 = 3x outer gaps
}

The gap values determine the default inner and outer horizontal and vertical gap sizes.

Refer to the Gaps topic.

enablegaps

gaps:
{
  ...
  enabled = true;  # whether gaps are enabled by default or not
  ...
}

The enabled value under the gaps grouping determines whether gaps between tiled windows are shown or not.

The default value here is used when the workspace rules have a gaps value of -1.

Refer to the Gaps topic and the togglegaps function.

smartgaps_fact

gaps:
{
  ...
  # smartgaps factor when there is only one client
  smartgaps_fact = 0;  # 0 = no gaps, 3 = 3x outer gaps
}

The smartgaps_fact value either removes or exaggerates gaps when there is only a single client visible on a workspace.

Refer to the SmartGaps functionality.

functionality

functionality:
{
  AutoReduceNmaster = false;  # automatically reduce the number of master clients if one is closed
  SmartGaps = false;  # enables no or increased gaps if there is only one visible window
  SmartGapsMonocle = false;  # enforces no gaps in monocle layout
  Systray = true;  # enables a systray in the bar
  Swallow = true;  # allows X applications started from the command line to swallow the terminal
  ...

The functionality setting controls whether specific features are enabled or disabled.

The user can control which features are enabled by uncommenting or commenting out listed options in this list.

Refer to the Functionality page for more details.

slop spawn style

slop:
{
  spawn_style = "-t 0 -c 0.92,0.85,0.69,0.3 -o";
  ...
}

The spawn_style slop option affects the appearance and behaviour of the select operation when using the riospawn function.

slop resize style

slop:
{
  ...
  resize_style = "-t 0 -c 0.92,0.85,0.69,0.3";
}

The resize_style slop option affects the appearance and behaviour of the select operation when using the rioresize function.

floatpos default grid size

floatpos:
{
  grid_x = 5;  # float grid columns
  grid_y = 5;  # float grid rows
  ...
}

The grid_x and grid_y settings controls the default grid size when using the floatpos grid placement feature.

toggle float position

floatpos:
{
  ...
  toggle_position = "50% 50% 80% 80%";  # default floating position when triggering togglefloating
}

The toggle_position setting defines the size and position of a window when it is first changed from tiled to floating using the togglefloating function.

default opacity

opacity:
{
  default = 0;
  ...
}

This setting controls the default opacity for new windows by setting the _NET_WM_WINDOW_OPACITY property on the window.

This depends on that the compositor will take this property into account.

Refer to the changeopacity function.

moveopacity

opacity:
{
  ...
  move = 0;
  ...
}

The move opacity config can be used to change the transparency level of a window while it is being moved.

Refer to the movemouse function.

resizeopacity

opacity:
{
  ...
  resize = 0;
  ...
}

The resize opacity config can be used to change the transparency level of a window while it is being resized.

Refer to the resizemouse function.

placeopacity

opacity:
{
  ...
  place = 0;
}

The place opacity config can be used to change the transparency level of a window while it is being placed.

Refer to the placemouse function.

indicator types

indicator:
{
  WsOcc = "none";
  WsSel = "none";
  WsVis = "none";
  WsNorm = "none";
  PinnedWs = "none";
  FakeFullScreen = "plus";
  FakeFullScreenActive = "plus_and_larger_square";
  FloatFakeFullScreen = "plus";
  FloatFakeFullScreenActive = "plus_and_larger_square";
  Tiled = "none";
  Floating = "top_left_larger_square";
  Selected = "none";
  ...
}

These define what kind of graphical indicators are used on the bar to:

  • show what workspaces that have clients on them (IndicatorWsOcc)
  • show which workspace is currently selected (IndicatorWsSel)
  • show which workspace is visible, but not selected (IndicatorWsVis)
  • show which workspace is not visible (IndicatorWsNorm)
  • show which workspaces are pinned (IndicatorPinnedWs), refer to the togglepinnedws function
  • highlight that a client window is available for fake fullscreen (IndicatorFakeFullScreen), refer to the FakeFullScreen flag
  • highlight that a client window is floating (IndicatorFloating), refer to the Floating topic
  • highlight that a client window is tiled (IndicatorTiled), refer to the Tiled topic

Refer to the Bar Indicators page.

custom 2d indicators

indicator:
{
  ...
  custom:
  {
    custom_1 = "^c#00A523^^r0,h,w,2^";  # green underline
    custom_2 = "^c#55cdfc^^r3,3,4,4^^c#E72608^^r4,4,2,2^";  # blue rectangle
    custom_3 = "^f-10^^c#E72608^𐄛";  # example using a character as an indicator
    custom_4 = "^c#E26F0B^^r0,h,w,1^^r0,0,1,h^^r0,0,w,1^^rw,0,1,h^";  # orange box
    custom_5 = "^c#CB9700^^r0,h,w,1^^r0,0,w,1^";  # top and bottom lines
    custom_6 = "^c#F0A523^^r6,2,1,-4^^r-6,2,1,-4^";  # orange vertical bars
  }
}

These are custom indicators that are using the status2d markup for special effects.

Refer to the Bar Indicators page.

client states persisted across restarts

restart:
  persist_client_states_across_restarts = true;
  ...

By default the state of clients are persisted across restarts. For example if a window is started on a particular workspace then the window will remain on that workspace when dusk is restarted.

If a client has been subject to a client rule then rules will not be reapplied when dusk is restarted. This may of course interfere when doing the initial setup of rules using runtime configuration. As such this setting allows for the feature to be disabled meaning that all existing windows will be treated as new windows, thus being subject to client rules. Note that if this is disabled then all windows that are not subject to client rules will end up on the first workspace.

workspace states persisted across restarts

restart:
  ...
  persist_workstate_states_across_restarts = true;

By default the state of workspaces are persisted across restarts. For example if you change the layout of a workspace then that layout will remain on the workspace when dusk is restarted.

This can, however, cause some confusion when configuring dusk using runtime configuration as specifying a new layout via workspace rules may not come into effect following a restart. As such this setting allows for the feature to be disabled meaning that workspaces will always revert back to their original settings as per workspace rules upon restart.

workspace preview factor

workspace:
{
  # When the WorkspacePreview functionality is enabled, this setting controls
  # the size of workspace previews relative to monitor size.
  preview_factor = 0.25;
  ...

The preview factor value controls the size of the workspace preview, relative to the monitor size, when the WorkspacePreview functionality is enabled.

workspace labels

workspace:
{
  ...
  labels:
  {
    occupied_format = "%s: %s";  # format of an occupied workspace label
    vacant_format = "%s";  # format of an empty / vacant workspace
    lower_case = true;  # whether or not to change workspace labels to lower case
    prefer_window_icons = false;  # whether to use window icons instead of labels when present
    swap_occupied_format = false;  # false gives "icon: label", true gives "label: icon" */
  }
  ...

These settings influence how workspace labels are presented.

Refer to the WorkspaceLabels functionality page for more details.

workspaces per monitor

workspace:
{
  ...
  per_monitor = false;
  ...

This configuration option controls how pinned workspaces are handled when the monitor they are on is removed.

The default behaviour is that the workspace becomes unpinned and is moved to another monitor.

If per_monitor is set to true then pinned workspaces will be hidden from view and any clients on these workspaces will be moved to the selected workspace on the first monitor.

In either case if the monitor comes back again then the workspaces will be moved back to that monitor provided that the workspace is pinned to the designated monitor in the workspace rules.

The per_monitor feature is specifically intended for the instructions in this guide.

workspace rules

workspace:
{
  ...
  rules = (
    { name = "1", pinned = false, icons: { def = "1", vac = "", occ = "[1]" }},
    { name = "2", pinned = false, icons: { def = "2", vac = "", occ = "[2]" }},
    { name = "3", pinned = false, icons: { def = "3", vac = "", occ = "[3]" }},
    { name = "4", pinned = false, icons: { def = "4", vac = "", occ = "[4]" }},
    { name = "5", pinned = false, icons: { def = "5", vac = "", occ = "[5]" }},
    { name = "6", pinned = false, icons: { def = "6", vac = "", occ = "[6]" }},
    { name = "7", pinned = false, icons: { def = "7", vac = "", occ = "[7]" }},
    { name = "8", pinned = false, icons: { def = "8", vac = "", occ = "[8]" }},
    { name = "9", pinned = false, icons: { def = "9", vac = "", occ = "[9]" }},
  )
}

The workspace rules defines the workspaces that are available, which monitor they are initially assigned to and whether the workspace is pinned to that monitor.

Additionally the rules specify the icons used for the workspace as well as the initial layout.

Refer to the Workspaces topic for more details.

bar

This section covers most of the settings related to configuring the bars.

bar:
{
  showbar = true;
  height  = 0;
  text_padding = 2;
  height_padding = 0;
  systray_spacing = 2;
  alpha_bg = 0xd0;
  ...

showbar

The showbar configuration item controls whether or not the bars are shown when the window manager first starts up.

Refer to the showbar and hidebar functions.

bar_height

By default the height of the bar is derived based on the font size.

This can be overridden by explicitly setting the bar height value.

Note that if the bars configuration specify an exact height for a bar then that will take precedence over the value set here.

bar padding (inner)

When text is drawn on the bar there is some blank space that is added on the left of the text and on the right of the text so that the text is not crammed to either side. This is referred to as the left/right padding (lrpad) and by default this is equal to the height of the font used.

This value represents the total amount of padding and it is divided equally between the left and right hand side of the text.

The text_padding setting can be used to adjust this value where a positive value will increase the padding and a negative value will reduce it.

The bar height (bh) is by default set to the height of the font used. The height_padding setting can be used to adjust the height of the bar where a positive value will increase the bar height and a negative value will reduce it.

If the bar height variable is set, however, then that will override the bar height as well as this height_padding setting.

Additionally if the bars configuration specify an exact height for a bar then that will take precedence.

systray spacing

The systray_spacing setting controls the spacing between icons in the systray.

Refer to the Systray functionality.

alpha

The alpha_bg sets the default background transparency level for colour schemes in dusk.

bars

bar:
	...
  bars = (
    # monitor      bar             x     y      w     h     name
    { monitor = 0, bar = 0, pos = "0%    0%     100% -1h ", name = "Primary top" },
    { monitor = 0, bar = 1, pos = "0%    100%   100% -1h ", name = "Primary bottom" },
    { monitor = 1, bar = 0, pos = "0%    0%     100% -1h ", name = "Secondary top" },
    { monitor = 1, bar = 1, pos = "0%    100%   100% -1h ", name = "Secondary bottom" },
    { monitor = 2, bar = 0, pos = "0%    0%     100% -1h ", name = "Tertiary top" },
    { monitor = 2, bar = 1, pos = "0%    100%   100% -1h ", name = "Tertiary bottom" },
  )
  ...

The bars setting defines the bars that are present on which monitors as well as their size and position.

You generally do not need to make any changes here unless you are specifically looking to experiment with smaller separate bars.

Refer to the Bar topic and the Bar Placement page.

bar rules

bar:
  ...
  rules = (
    { monitor = -1, bar = 0, module = "powerline",         align = "left",        value = "PwrlForwardSlash" },
    { monitor =  0, bar = 0, module = "status",            align = "left",        value = 7, padding = 5, name = "status7" },
    { monitor =  0, bar = 0, module = "powerline",         align = "left",        value = "PwrlForwardSlash" },
    { monitor = -1, bar = 0, module = "workspaces",        align = "left",        value = "PwrlForwardSlash", name = "workspaces" },
    ...

While the bars config determines the size and position of the bars the bar rules control which bar modules are included on a bar as well as their placement.

Refer to the Bar topic and the Bar Rules page.

flexwintitle weights

flexwintitle:
{
  masterweight = 15; # master weight compared to hidden and floating window titles
  stackweight  = 4;  # stack weight compared to hidden and floating window titles
  hiddenweight = 0;  # hidden window title weight
  floatweight  = 0;  # floating window title weight, set to 0 to not show floating windows
  separator    = 5;  # width of client separator
  ...

The flexwintitle weights control the size of window titles in the bar. This allows for the window title of a master client to be bigger than that of stack clients as an example.

A weight of 0 means above means that hidden and floating windows will not be drawn alongside tiled master and stack window titles.

The separator value controls the amount of space between window titles in the bar. Note that this separator is only used if powerline separators is not used between window titles.

Refer to the flexwintitle page for more details.

icon size

flexwintitle:
{
  ...
  icon:
  {
    size    = 16;    # icon size
    spacing = 5;     # space between icon and title
  }
}

These define the window title icon size and the distance between the icon and the window title text.

Not all applications provide an icon.

Refer to the flexwintitle page for more details.

colors

colors:
{
  SchemeNorm        = { fg = "#D9CFC5", bg = "#492B2D", border = "#492B2D" },
  SchemeTitleNorm   = { fg = "#D9CFC5", bg = "#492B2D", border = "#643B3E" },
  SchemeTitleSel    = { fg = "#D9CFC5", bg = "#82363A", border = "#82363A" },
  SchemeScratchNorm = { fg = "#D9CFC5", bg = "#492B2D", border = "#643B3E" },
  SchemeScratchSel  = { fg = "#D9CFC5", bg = "#82363A", border = "#82363A" },
  SchemeHidNorm     = { fg = "#D9CFC5", bg = "#492B2D", border = "#000000" },
  SchemeHidSel      = { fg = "#D9CFC5", bg = "#82363A", border = "#000000" },
  SchemeUrg         = { fg = "#E0E0E0", bg = "#A23419", border = "#A23419" },
  SchemeMarked      = { fg = "#DDC470", bg = "#724559", border = "#724559" },
  SchemeWsNorm      = { fg = "#D9CFC5", bg = "#492B2D", border = "#000000" },
  SchemeWsVisible   = { fg = "#D9CFC5", bg = "#82363A", border = "#000000" },
  SchemeWsSel       = { fg = "#D9CFC5", bg = "#82363A", border = "#000000" },
  SchemeWsOcc       = { fg = "#D9CFC5", bg = "#492B2D", border = "#000000" },
}

The colors array defines the colours used in the bar and in the window border.

Each colour scheme consists of a foreground colour which is used for text, a background colour that is used for the background in the bar, and a border colour that is used for the border around windows.

Optionally, fourth value "resource" can be used to specify a resource prefix that will be used in relation to loading colour schemes via Xresources. The built-in colour schemes will fall back to internal defaults when it comes to resource prefixes hence they are not included in the configuration above.

Should you need to add your own custom colour schemes then you can do so by expanding on the corresponding enum in dusk.c. Start by searching for "SchemeNorm". There is also a guide that will walk you through that.

layouts

layouts = (
  { name = "tile",                 symbol = "[]=", split = "VERTICAL",            master = "TOP_TO_BOTTOM",      stack = "TOP_TO_BOTTOM" },
  { name = "columns",              symbol = "|||", split = "NO_SPLIT",            master = "LEFT_TO_RIGHT",      stack = "LEFT_TO_RIGHT" },
  { name = "rows",                 symbol = "===", split = "NO_SPLIT",            master = "TOP_TO_BOTTOM",      stack = "TOP_TO_BOTTOM" },
  { name = "monocle",              symbol = "[M]", split = "NO_SPLIT",            master = "MONOCLE",            stack = "MONOCLE" },
  { name = "col",                  symbol = "||=", split = "VERTICAL",            master = "LEFT_TO_RIGHT",      stack = "TOP_TO_BOTTOM" },
  { name = "floating master",      symbol = ">M>", split = "FLOATING_MASTER",     master = "LEFT_TO_RIGHT",      stack = "LEFT_TO_RIGHT" },
  { name = "deck",                 symbol = "[D]", split = "VERTICAL",            master = "TOP_TO_BOTTOM",      stack = "MONOCLE" },
  { name = "bstack",               symbol = "TTT", split = "HORIZONTAL",          master = "LEFT_TO_RIGHT",      stack = "LEFT_TO_RIGHT" },
  { name = "bstackhoriz",          symbol = "===", split = "HORIZONTAL",          master = "LEFT_TO_RIGHT",      stack = "TOP_TO_BOTTOM" },
  { name = "bstackgrid",           symbol = "==#", split = "HORIZONTAL",          master = "TOP_TO_BOTTOM",      stack = "GAPLESSGRID_CFACTS" },
  { name = "centeredmaster",       symbol = "|M|", split = "CENTERED_VERTICAL",   master = "LEFT_TO_RIGHT",      stack = "TOP_TO_BOTTOM",     stack2 = "TOP_TO_BOTTOM" },
  { name = "centeredmaster horiz", symbol = "-M-", split = "CENTERED_HORIZONTAL", master = "TOP_TO_BOTTOM",      stack = "LEFT_TO_RIGHT",     stack2 = "LEFT_TO_RIGHT" },
  { name = "gapless grid",         symbol = ":::", split = "NO_SPLIT",            master = "GAPLESSGRID_CFACTS", stack = "GAPLESSGRID_CFACTS" },
  { name = "fibonacci dwindle",    symbol = "[\]", split = "NO_SPLIT",            master = "DWINDLE_CFACTS",     stack = "DWINDLE_CFACTS" },
  { name = "fibonacci spiral",     symbol = "(@)", split = "NO_SPLIT",            master = "SPIRAL_CFACTS",      stack = "SPIRAL_CFACTS" },
  { name = "tatami mats",          symbol = "[T]", split = "VERTICAL",            master = "LEFT_TO_RIGHT",      stack = "TATAMI_CFACTS" },
  { name = "floating",             symbol = "><>" },
)

This defines the predefined layouts that are available in the window manager.

For more information about how the symbol is used refer to the LtSymbol bar module.

For the rest refer to the Layout topic.

button bindings

button_bindings = (
  { click = "ClkLtSymbol", modifier = "None", button = 1, function = "setlayout", argument = -1 },  # toggles between current and previous layout
  { click = "ClkLtSymbol", modifier = "None", button = [4, 5], function = "cyclelayout", argument = [+1, -1] },  # cycle through the available layouts
  { click = "ClkWinTitle", modifier = "None", button = 1, function = "focuswin" },  # focus on the given client
  { click = "ClkWinTitle", modifier = "None", button = 3, function = "showhideclient" },  # hide the currently selected client (or show if hidden)
  { click = "ClkWinTitle", modifier = "None", button = 2, function = "zoom" },  # moves the currently focused window to/from the master area (for tiled layouts)
  { click = "ClkStatusText", modifier = "None", button = [1, 2, 3, 4, 5, 6, 7, 8, 9], function = "statusclick", argument = [1, 2, 3, 4, 5, 6, 7, 8, 9] },  # sends mouse button presses to statusclick script when clicking on status modules
  { click = "ClkStatusText", modifier = "Shift", button = [1, 2, 3], function = "statusclick", argument = [10, 11, 12] },
  { click = "ClkClientWin", modifier = "Super", button = [8, 9], function = "markmouse", argument = [1, 0] },  # toggles marking of clients under the mouse cursor for group action
  { click = "ClkClientWin", modifier = "Super", button = 1, function = "moveorplace", argument = 1 },  # moves a client window into a floating or tiled position depending on floating state
  { click = "ClkClientWin", modifier = "Super+Shift", button = 1, function = "togglemoveorplace" },  # as above, but forces a tiled client to become floating and vice versa
  { click = "ClkClientWin", modifier = "Super+Alt", button = 2, function = "togglefloating" },  # toggles between tiled and floating arrangement for given client
  { click = "ClkClientWin", modifier = "Super", button = 3, function = "resizeorfacts" },  # toggles between tiled and floating arrangement for given client
  { click = "ClkClientWin", modifier = "Super+Shift", button = 3, function = "resizemouse" },  # change the size of a floating client window
  { click = "ClkClientWin", modifier = "None", button = 8, function = "movemouse" },  # move a client window using extra mouse buttons (previous)
  { click = "ClkClientWin", modifier = "None", button = 9, function = "resizemouse" },  # resize a client window using extra mouse buttons (next)
  { click = "ClkClientWin", modifier = "Super", button = 2, function = "zoom" },  # moves the currently focused window to/from the master area (for tiled layouts)
  { click = ["ClkClientWin", "ClkRootWin"], modifier = "Super+Ctrl", button = 1, function = "dragmfact" },  # dynamically change the size of the master area compared to the stack area(s)
  { click = ["ClkClientWin", "ClkRootWin"], modifier = "Super+Ctrl", button = 3, function = "dragwfact" },  # dynamically change the size of a workspace relative to other workspaces
  { click = "ClkClientWin", modifier = "Super", button = [4, 5], function = "inplacerotate", argument = [+1, -1] },  # rotate clients within the respective area (master, primary stack, secondary stack)
  { click = "ClkClientWin", modifier = "Super+Shift", button = [4, 5], function = "rotatestack", argument = [+1, -1] },  # rotate all clients
  { click = "ClkWorkspaceBar", modifier = "None", button = 1, function = "viewws" },  # view the workspace by clicking on workspace icon
  { click = "ClkWorkspaceBar", modifier = "Super", button = 1, function = "movews" },  # sends (moves) the currently focused client to given workspace
  { click = "ClkWorkspaceBar", modifier = "Super+Shift+Ctrl", button = 1, function = "swapws" },  # swaps all clients on current workspace with that of the given workspace
  { click = "ClkWorkspaceBar", modifier = "None", button = 3, function = "enablews" },  # enables the workspace in addition to other workspaces
  { click = "ClkWorkspaceBar", modifier = "None", button = [4, 5], function = "viewwsdir", argument = [+2, -2] },  # view the workspace adjacent of current workspace that has clients (on the current monitor)
  { click = "ClkWorkspaceBar", modifier = "Super", button = 2, function = "togglepinnedws" },  # toggles the pinning of a workspace to the current monitor
)

The buttons settings is used by the internal key handler to bind mouse button clicks to certain function calls.

One feature specific to runtime configuration is that related key and button bindings can be expressed by the use of lists to act as multipliers.

For example lets say that we want to trigger the cyclelayout function when using the scroll wheel (buttons 4 and 5) on the layout symbol and passing 1 or -1 as the cycle direction.

In the compile-time configuration it would look like this:

  { ClkLtSymbol,  0,  Button4,  cyclelayout,  {.i = +1 } }, // cycle through the available layouts
  { ClkLtSymbol,  0,  Button5,  cyclelayout,  {.i = -1 } }, // cycle through the available layouts (in reverse)

and it can of course be expressed the same way in runtime configuration:

  { click = "ClkLtSymbol", button = 4, function = "cyclelayout", argument = +1 },  # cycle through the available layouts
  { click = "ClkLtSymbol", button = 5, function = "cyclelayout", argument = -1 },  # cycle through the available layouts (in reverse)

but, we can also express this as one binding by placing the variants in arrays.

{ click = "ClkLtSymbol", button = [4, 5], function = "cyclelayout", argument = [+1, -1] },  # cycle through the available layouts

This makes more of a difference when it comes to bindings such as statusclick, scratchpad, workspace and stacker bindings.

Refer to the Button Bindings page for more details.

keybindings

keybindings = (
  { modifier = "Super", key = "d", function = "spawn", argument = "dmenucmd" },  # spawn dmenu for launching other programs
  { modifier = "Super", key = "Return", function = "spawn", argument = "termcmd" },  # spawn a terminal
  { modifier = "Super+Shift", key = "Return", function = "riospawn", argument = "termcmd" },  # draw/spawn a terminal
  ...

The keybindings settings is used by the internal key handler to bind keyboard shortcuts to certain function calls.

Refer to the Key Bindings page for more details.

stacker icons

stacker_icons = {
  prefix = "[",
  suffix = "]",
  position = "RightOfWindowIcon",
  overrides = ()
}

The stacker icons complements the stacker utilities by providing keyboard shortcut hints that are added to client window titles where applicable.

While the compile time configuration has a stackericons array that need to mirror the STACKKEYS list for this to work, the runtime configuration, on the other hand, derives the icons to use based on the stacker keybindings.

The icon symbol can optionally have a prefix and/or a suffix, e.g. for the keybinding "a" combined with square brackes we end up with the stacker icon of "[a]".

The position adds some control over where the stacker icon is placed in the window title. The position options are:

  • RightOfWindowIcon
  • LeftOfWindowIcon
  • TitlePrefix
  • TitleSuffix
  • TitleEllipsis

Overrides allow for longer named keysyms to be replaced with something shorter like a single character.

Example configuration:

  overrides = (
    { replace: "comma", with: "," },
    { replace: "semicolon", with: ";" },
  )

The prefix, suffix and overrides settings can contain status2d markup.

Refer to the StackerIcons functionality for more details.

client rules

client_rules = (
  { wintype = "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", flags = ["Unmanaged"] },
  { wintype = "DESKTOP", flags = ["Unmanaged", "Lower"] },
  { wintype = "DOCK", flags = ["Unmanaged", "Raise"] },
  ...

The client_rules settings is a list of application specific rules that should apply when programs start.

Refer to the Client Rules page.

Refresh rates

refresh_rates:
{
  global_hz = 60;
  #dragcfact_hz = 60;
  #dragfact_hz = 60;
  #dragmfact_hz = 60;
  #dragwfact_hz = 60;
  #movemouse_hz = 60;
  #placemouse_hz = 60;
  #resizemouse_hz = 60;
  #swallowmouse_hz = 60;
  #markmouse_hz = 60;
}

When using the mouse to perform certain operations like moving windows around, resizing windows or changing the master/stack factor then the refresh rate is by default set to 60 frames per second.

In practice this means that the window manager will only pick up mouse cursor movement notifications at that interval. The number 60 is chosen as good middle ground between smooth operation and that it will still perform well on a low spec computer.

By default end users are not expected to change the refresh rate values, but users with a performant machine and monitors with higher refresh rates may want to increase the refresh rate to e.g. 120Hz.

In general setting a higher refresh rate will make certain operations feel more smooth.

The main risk is that if the handling of a mouse movement notification takes longer than the interval at which the window manager picks them up then the window manager may start to lag behind with an increasing backlog of notifications to pick up.

Some mouse operations may be heavier computation wise and result in lag when setting a higher refresh rate. As such it is possible to specify the refresh rate on a per function basis so that they can be tuned individually.

The global_hz, as the name suggests, controls the refresh rate of all mouse operations globally unless a function specific refresh rate has been specified.

⚠️ **GitHub.com Fallback** ⚠️