Skip to content
mautamu edited this page Oct 17, 2024 · 102 revisions

Configuring LeftWM

All code snippets in this section refer to the file ~/.config/leftwm/config.ron
All entries require a modifier, even if blank: modifier: [] For migrating you old config to ron please follow this guide.

Note: for config in toml please refer to the legacy documentation.

Important: You will need to reload (recommended SoftReload, as it tries to preserve the WM state as far as possible) in order to apply changes to config.ron.

Terms

  • Default refers to the original config.ron specified when LeftWM first runs.
  • Partial Default refers to a command that is in the original config.ron but is not the only instance of that command.
  • Example refers to a snippet that is not in the original config.ron but can be added or modified for additional features.

Table of contents

Autostart

Actually not part of config.ron but kind of belongs here: There are basically three ways to autostart applications with LeftWM session login (and restart them when executing SoftReload/HardReload)

  1. XDG_AUTOSTART: to use this, place a .desktop file in ~/.config/autostart (more info about desktop entries can be found in the ArchWiki
  2. up/down scripts in the theme
  3. the same scripts can be placed in ~/.config/leftwm/ in order to be theme agnostic

Note: there is no override rules between "theme-scripts" and "config-scripts", as they are agnostic of each other.

File Header

Some fields in this config are optional. By default ron expects you to wrap the values of those fields in Some(...) expressions. This can be avoided by putting this on the top of the file:

#![enable(implicit_some)]

Logging

Logging level is controlled by the log_level option. You can change it at any time and reload LeftWM for it to apply (SoftReload or HardReload commands).

Possible values are the usual logging levels, from most verbose to less: trace, info, debug, error.

Backend

Leftwm has currently two implemented backends:

  • XLib is the legacy backend, using the libX11 C library.
  • X11rb, based on the x11rb crate, a rust implementation of x11.

You can switch backend with the backend option:

Default: backend: XLib

Example: backend: X11rb

Modkey

The modkey is the most important setting. It is used by many other settings and controls how key bindings work. For more info please read this post on x11 Mod keys.

Default: modkey: "Mod4" (windows key)

Example: modkey: "Mod1"

Mousekey

The mousekey is similarly quite important. This value can be used to determine which key, when held, can assist a mouse drag in resizing or moving a floating window or making a window float or tile. For more info please read this post on x11 Mod keys.

Default: mousekey: "Mod4" (windows key)

Example: mousekey: "Mod1"

0.3.0 Example: mousekey: ["Mod4", "Shift"]

Disable Tile Dragging

This allows you to make it so tiled windows can not be moved or resized with the mouse. However the mouse will still be able to interact with floating windows.

Default: disable_tile_drag: false

Tag Behaviour

Starting with LeftWM 0.2.7, the behaviour of SwapTags was changed such that if you are on a tag, such as tag 1, and then SwapTags to tag 1, LeftWM will go to the previous tag instead. This behaviour can be disabled with disable_current_tag_swap:

Default: disable_current_tag_swap: false

Example: disable_current_tag_swap: true (returns to old behaviour)

Focus Behaviour

LeftWM now has 3 focusing behaviours (Sloppy, ClickTo, and Driven) and 2 options (focus_new_windows, sloppy_mouse_follows_focus), which alter the way focus is handled. These encompass 5 different patterns:

  1. Sloppy Focus. Focus follows the mouse, hovering over a window brings it to focus. This behaviour have a variant which is toggled with the sloppy_mouse_follows_focus option:
    • When true, the cursor will follow the focus and teleport to the window that takes focus.
    • When false, the cursor isn't moved by LeftWM at all.
  2. Click-to-Focus. Focus follows the mouse, but only clicks change focus.
  3. Driven Focus. Focus disregards the mouse, only keyboard actions drive the focus.
  4. Event Focus. Focuses when requested by the window/new windows.

Default:

focus_behaviour: Sloppy // Can be Sloppy, ClickTo, or Driven
focus_new_windows: true

Note: This is only available in LeftWM >=0.2.8.

Window Creation and Focus

In multi-workspace layouts (such as with multiple monitors), LeftWM will, by default, create a new window on the workspace where the cursor is currently located, even if that workspace is not the workspace which is focused. In Click-to-Focus and Driven Focus modes, however, it is often desirable to create the window in the focused workspace, not the one wherein the mouse is located. The create_follows_cursor feature allows for changing this behavior. New windows will be created in the workspace:

  • Containing the cursor when unset (None), Some(true), or when the cursor is in Sloppy mode
  • Which is focused when set to Some(false)

Default:

disable_cursor_reposition_on_resize = false

Note: This is only available in LeftWM >=0.4.2.

Layouts

Leftwm supports user definable layouts. The relevant entries in the configuration file are the layouts and layout_definitions lists.

Only the layouts whose name appears in layouts will be accessible when switching layouts through the commands NextLayout, PreviousLayout and SetLayout. Each layout appearing in the layouts list must have a corresponding definition in layout_definitions.

Note. Layouts named Monocle and MainAndDeck are treated specially by leftwm as they involve reshuffling the window order when the focus is changed.

Example:

layouts: [
    "Monocle",
    "MainAndDeck",
    "MainAndVertStack",
],
layout_definitions: [
    (name: "EvenHorizontal", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: None, stack: (flip: None, rotate: North, split: Vertical), second_stack: None)),
    (name: "EvenVertical", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: None, stack: (flip: None, rotate: North, split: Horizontal), second_stack: None)),
    (name: "Monocle", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: None, stack: (flip: None, rotate: North, split: None), second_stack: None)),
    (name: "Grid", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: None, stack: (flip: None, rotate: North, split: Grid), second_stack: None)),
    (name: "MainAndVertStack", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: Horizontal), second_stack: None)),
    (name: "MainAndHorizontalStack", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: Vertical), second_stack: None)),
    (name: "RightMainAndVertStack", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: South, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: Horizontal), second_stack: None)),
    (name: "Fibonacci", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: Fibonacci), second_stack: None)),
    (name: "Dwindle", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: Dwindle), second_stack: None)),
    (name: "MainAndDeck", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: None), stack: (flip: None, rotate: North, split: None), second_stack: None)),
    (name: "CenterMain", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: None), second_stack: (flip: None, rotate: North, split: Horizontal))),
    (name: "CenterMainBalanced", flip: None, rotate: North, reserve: None, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: Dwindle), second_stack: (flip: None, rotate: North, split: Dwindle))),
    (name: "CenterMainFluid", flip: None, rotate: North, reserve: Reserve, columns: (flip: None, rotate: North, main: (count: 1, size: 0.5, flip: None, rotate: North, split: Vertical), stack: (flip: None, rotate: North, split: None), second_stack: (flip: None, rotate: North, split: Horizontal))),
]

Layout Mode

Leftwm now has 2 layout modes, Workspace and Tag. These determine how layouts are remembered. When in Workspace mode, layouts will be remembered per workspace. When in Tag mode, layouts are remembered per tag.

Default:

layout_mode: Tag // Can be Workspace or Tag

Tags

Tags are the names of the virtual desktops where windows live. In other window managers these are sometimes just called desktops. You can rename them to any unicode string including symbols/icons from popular icon libraries such as font-awesome.

Default: tags: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]

Example: tags: ["Browser ♖", "Term ♗", "Shell ♔", "Code ♕"]

Default Height and Width for Floating Windows

The command ToggleFloating toggles the focused window between tiling and floating modes. The configuration settings default_height and default_width are used to determine the dimensions when switching from tiling to floating.

Default:

default_width: 800,
default_height: 600,

Max Window Width

This feature was introduced in PR #482

You can configure a max_window_width to limit the width of the tiled windows (or rather, the width of columns in a layout). This feature comes in handy when working on ultra-wide monitors where you don't want a single window to take the complete workspace width.

Demonstration

Without max_window_width

 ----------------------------------------------- 
| --------------------------------------------- |
||                                             ||
||                     1                       ||  [49' monitor]
||                                             ||
| --------------------------------------------- |
 ----------------------------------------------- 
 ----------------------------------------------- 
| ---------------------- ---------------------- |
||                      |                      ||
||          1           |          2           ||  [49' monitor]
||                      |                      ||
| ---------------------- ---------------------- |
 ----------------------------------------------- 

With max_window_width

 ----------------------------------------------- 
|                ---------------                |
|               |               |               |
|               |       1       |               |  [49' monitor]
|               |               |               |
|                ---------------                |
 ----------------------------------------------- 

                ^^^^^^^^^^^^^^^^^
                MAX_WINDOW_WIDTH
 ----------------------------------------------- 
|         -------------- --------------         |
|        |              |              |        |
|        |       1      |       2      |        |  [49' monitor]
|        |              |              |        |
|         -------------- --------------         |
 ----------------------------------------------- 

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              MAX_WINDOW_WIDTH * 2

This setting can be configured either globally, per workspace, or both. The workspace specific configuration always takes precedence over the global setting.

Values: An int value for absolute pixels (2200 means 2200px), or a decimal value for fractions (0.4 means 40%).
Default: Has no default value. No value means no width limit.

Example:

// global configuration: 40%
max_window_width: 0.4

workspaces =
[(output: "HDMI-1",
y: 0,
x: 0,
height: 1440,
width: 2560,
// workspace specific configuration: 1200px
max_window_width: 1200,
)]

Note: This is only available in LeftWM >=0.2.9. It is currently only available through aur/leftwm-git or building from source.

Workspaces

Workspaces are how you view tags (desktops). A workspace is an area on a screen or most likely the whole screen. in these areas you can view a given tag.

Default: workspaces: [] (one workspace per screen)

Workspaces are only applied if the specified output is the name of a connected screen. The output is also used as identifier of the workspace.

You can get the output names by running xrandr in your terminal.

Example (two workspaces on a single ultrawide):

workspaces: [
    ( output: "HDMI-1", y: 0, x: 0, height: 1440, width: 1720 ),
    ( output: "HDMI-1", y: 0, x: 1720, height: 1440, width: 1720 ),
]

You can also use the relative field to simplify configuration. If set to true, all size-related fields get relative to the output's current setup. You can set multiple workspaces per screen.

Again the example for an ultra-wide screen:

workspaces: [
    ( output: "HDMI-1", relative: true, y: 0, x: 0, height: 1440, width: -1720 ), // Subtract from full screen width.
    ( output: "HDMI-1", relative: true, y: 0, x: 1720, height: 1440, width: -1720 ),
]

You can refer to a specific workspace by output in theme.toml like below:

gutter: [
    // set a 20 pixel margin on the left side of screen HDMI-1
    ( side: Left, value: 20, output: "HDMI-1" ),
    // set a 20 pixel margin on the right side of screen eDP1
    // Here, the second defined workspace for eDP1 is specified.
    ( side: Right, value: 20, output: "eDP1", id: 2 )
]

Auto Derive Workspaces

This feature was introduced in #848

You can configure this feature if you want a hardcoded workspace layout. If you set it to false, leftwm will not try to automatically assign each screen at least one workspace and thus will only use workspaces specifically defined in #Workspaces.

If no workspace in the hardcoded workspaces matches a currently connected screen, this will fall back to true to prevent a broken setup.

Default:

auto_derive_workspaces: true

Window Rules

Window rules allow to define how a window matching some properties should be spawned. As of now, a window can be matched by two properties:

  • window_class, corresponding to the property WM_CLASS of a window in a X server.
  • window_title, corresponding to the _NET_WM_NAME or the WM_NAME of a window. Both will be inspected if a window rule is defined by window_title. This takes precedence over window_class, since it is more specific.

The properties of a window can be inspected by launching xprop on a terminal and clicking the desired window.

Both window_class and window_title can be given as an exact string match or regular expression correspoding to RE2 Syntax

These window rules are currently implemented:

  • spawn_floating When specified, spawns the window in floating or (when false) in tiling mode.
  • spawn_fullscreen When specified, spawns the window fullscreened or (when false) in tiling mode.
  • spawn_sticky When specified, makes the window sticky.
  • spawn_on_tag Spawns the window on the specified tag.
  • spawn_on_workspace Spawns window on the first found workspace on this output.
  • spawn_on_workspace_id When multiple workspaces are on a output, use the first/second/... found, starting with 1.
  • hiding_strategy When specified, will force the window to hide in a certain way. See Window Hiding Strategies for values. (Note: This is only available in LeftWM >=0.5.2.)

Example:

window_rules: [
  // windows whose WM_CLASS is "Navigator" will be spawn on tag 2 (by position, 1-indexed)
  ( window_class: "Navigator", spawn_on_tag: 2 ),
  // windows whose window title is "Pentablet" will be spawned floating on tag 9
  ( window_title: "Pentablet", spawn_on_tag: 9, spawn_floating: true ),
  // windows whose WM_CLASS matches "*.app_2.*" regular expression will be spawn on tag 2
  ( window_class: "*.app_2*", spawn_on_tag: 2 ),
  // windows whose window_title matches `*.app_5.*` regular expression will be spawn on tag 5
  ( window_title: "*.app_5.*", spawn_on_tag: 5 ),
  // windows whose window_title matches `*.app_6.*` regular expression will use the unmap hiding strategy
  ( window_title: "*.app_6.*", hiding_strategy: Unmap),
]

When should we match the different properties?

Having the flexibility to match by class or title was found to be important for the user experience. This decision also follows the previous art in other tiling window managers like xmonad or dwm.

While WM_CLASS is more robust (the title of a window may be changed during the lifetime of the window), windows with the same class may vary in the desired behavior. For instance, a GUI program like krita may spawn floating children windows (same WM_CLASS, different WM_TITLE). Setting a rule for krita like

window_rules: [ 
  ( window_class: "krita", spawn_on_tag: 3 ),
]

would spawn also the children windows on tag 3 even if the parent krita window was moved to a different tag after launch (which is quite annoying!). In this case, the user most likely wants to use the window_title for the parent window or define other rules for the different child windows (window_title rules take precedence over window_class rules).

Note: This is only available in LeftWM >=0.3.0.

Window Hiding Strategies

  • Map (Default) Move the windows out of the visible area and don't minilize them. This should allow all applications to be captured by any other applications.This could result in higher resource usage, since windows will render their content like normal even if hidden.
  • Unmap The common behaviour for a window manager, but it prevents hidden windows from being captured by other applications
  • MoveMinimize Move the windows out of the visible area, so it can still be captured by some applications. We still inform the window that it is in a "minimized"-like state, so it can probably decide to not render its content as if it was focused.

Note: This is only available as a window rule in LeftWM >=0.5.2.

Scratchpads

A scratchpad is a set of windows which you can call to any tag and hide it when not needed. These windows can be any set of application which can be run from a terminal. To call a scratchpad you will require a keybind for ToggleScratchPad. When you want to manipulate the currently focused scratchpad, other commands like ReleaseScratchPad, AttachScratchPad and NextScratchPadWindow/PrevScratchPadWindow are available.

Example:

scratchpad: [
    ( name: "Alacritty", // This is the name which is referenced when calling (case-sensitive)
      value: "alacritty", // The command to load the application if it isn't started (first application to start)
      args: ["-e", "python"], // Any arguments to pass to the command
      // x, y, width, height are in pixels when an integer is inputted or a percentage when a float is inputted.
      // These values are relative to the size of the workspace, and will be restricted depending on the workspace size.
      x: 860, y: 390, height: 300, width: 200 
    ),
]

Note: The scratchpad and ToggleScratchPad are only available in LeftWM >=0.2.8, the other scratchpad manipulating commands in LeftWM 0.2.11, and args in >0.5.1

Keybind

All other commands are keybindings. you can think of key bindings as a way of telling LeftWM to do something when a key combination is pressed. There are several types of key bindings. In order for the keybind event to fire, the keys listed in the modifier section should be held down, and the key in the key section should then be pressed. Here is a list of all keys LeftWM can use as a modifier or a key.

Example:

Ron only uses the compact notation like this, so all the keybinds are supposed to be placed inside the brackets of keybind: [...]:

keybind: [
    ( command: Execute, value: "vlc https://www.youtube.com/watch?v=oHg5SJYRHA0", modifier: [], key: "XF86XK_AudioPlay" ),
    ( command: HardReload, key: "b" , modifier: ["modkey", "Shift"]),
    ( modifier: ["modkey", "Shift"], key: "q", command: CloseWindow ),
]

A few notes:

  • As it is a common pitfall for users of AZERTY keyboards you can find the relevant keysyms for tag related keybinds here.
  • As of version 0.3.0, the modifier field does not need to be specified and can be a single value or an array.
  • Even if blank, a modifier must be present! Use modifier: [] for no modifier.
  • The order of the fields does not matter, but it is recommended to keep the style uniform throughout the file for easier maintenance and troubleshooting.
  • NumLock and CapsLock are ignored as modifiers for keys, and will have no effect on your keybindings. See lefthk_core::grab_key for specifics.
    • Because these modifiers are ignored, you can't bind KP_1 through KP_9. Run xmodmap -pke | grep "KP_" to see the alternative names for the keypad keys.
    • If you want to use the NumPad for tag navigation you can find a config snippet here.
    • The value provided to commands referencing tags (ex. GotoTag), is not the name of the tag but the index of the tag in the tag list (starting from 1 for the first tag).

Keybind Commands

Execute

Execute a shell command when a key combination is pressed.

Partial default:

(command: Execute,
modifier: ["modkey"],
key: "p"
value: "rofi -show run")

Note: This command requires a value field to be specified.

HardReload

Completely restarts LeftWM.

Example:

(command: HardReload,
modifier: ["modkey", "Shift"],
key: "b")

SoftReload

Restarts LeftWM but remembers the state of all windows. This is useful when playing with the config file or themes.

Default:

(command: SoftReload,
modifier: ["modkey", "Shift"],
key: "r")

CloseWindow

Closes the window that is currently focused. This is not a forceful quit. It is equivalent to clicking the (x) in the top right of a window normally.

Default:

(command: CloseWindow,
modifier: ["modkey", "Shift"],
key: "q")

MoveToLastWorkspace

Takes the window that is currently focused and moves it to the workspace that was active before the current workspace.

Default:

(command: MoveToLastWorkspace,
modifier: ["modkey", "Shift"],
key: "w")

MoveWindowToNextWorkspace

Takes the window that is currently focused and moves it to the next workspace.

Example:

(command: MoveWindowToNextWorkspace,
modifier: ["modkey", "Shift"],
key: "Right")

MoveWindowToPreviousWorkspace

Takes the window that is currently focused and moves it to the previous workspace.

Example:

(command: MoveWindowToPreviousWorkspace,
modifier: ["modkey", "Shift"],
key: "Left")

FloatingToTile

Snaps the focused floating window into the workspace below.

Example:

(command: FloatingToTile,
modifier: ["modkey", "Shift"],
key: "t")

TileToFloating

Switch the focused window to floating mode when it is tiled

Example:

(command: TileToFloating,
modifier: ["modkey", "Shift"],
key: "f")

ToggleFloating

Switch the focused window between floating and tiled mode.

Example:

(command: ToggleFloating,
modifier: ["modkey", "Control"],
key: "f")

MoveWindowUp

Re-orders the focused window within the current workspace (moves up in order).

Default:

(command: MoveWindowUp,
modifier: ["modkey", "Shift"],
key: "Up")

MoveWindowDown

Re-orders the focused window within the current workspace (moves down in order).

Default:

(command: MoveWindowDown,
modifier: ["modkey", "Shift"],
key: "Down")

MoveWindowTop

Re-orders the focused window within the current workspace (moves to the top of the stack). Takes an optional argument, if it is set to false, calling the command while the top window is focused results in no action. Otherwise it will move the top window one position down. By default it will move the top window one position down.

Default:

(command: MoveWindowTop,
modifier: ["modkey"],
key: "Return")

SwapWindowTop

Swaps the focused window with the window on top of the stack in the current workspace. Takes an optional argument, if it is set to false, calling the command while the top window is focused results in no action. Otherwise it will swap the top window with the one below it. By default it will swap with the one below it.

Example:

(command: SwapWindowTop,
modifier: ["modkey"],
key: "Return")

MoveToTag

Moves a window to a given tag.

Partial default:

(command: MoveToTag,
value: "1",
modifier: ["modkey", "Shift"],
key: "1")

Note: This command requires a value field to be specified.

FocusWindowUp

Focuses the window that is one higher in order on the current workspace.

Default:

(command: FocusWindowUp,
modifier: ["modkey"],
key: "Up")

FocusWindowDown

Focuses the window that is one lower in order on the current workspace.

Default:

(command: FocusWindowDown,
modifier: ["modkey"],
key: "Down")

FocusWindowTop

Focuses the top (main) window on the current workspace. If value is true, it will select the previous window if the top window is already focused

Default:

(command: FocusWindowTop,
modifier: ["modkey"],
value: false,
key: "m")

Note: This is only available in LeftWM >=0.2.11.

Note: If a value is not provided, it will default to false

NextLayout

Changes the workspace to the next layout.

Default:

(command: NextLayout,
modifier: ["modkey", "Control"],
key: "Up")

PreviousLayout

Changes the workspace to the previous layout.

Default:

(command: PreviousLayout,
modifier: ["modkey", "Control"],
key: "Down")

SetLayout

Changes the workspace to the specified layout.

Example:

(command: SetLayout,
value: "Monocle",
modifier: ["modkey"],
key: "m")

Note: This command requires a value field to be specified.

RotateTag

Rotates the tag/layout. If the layout supports it, the tag will flip horizontally, vertically, or both. For example the fibonacci layout rotates in the four different directions.

Example:

(command: RotateTag,
modifier: ["modkey"],
key: "z")

FocusWorkspaceNext

Moves the focus from the current workspace to the next workspace (next screen).

Default:

(command: FocusWorkspaceNext,
modifier: ["modkey"],
key: "Right")

FocusWorkspacePrevious

Moves the focus from the current workspace to the previous workspace (previous screen).

Default:

(command: FocusWorkspacePrevious,
modifier: ["modkey"],
key: "Left")

GotoTag

Changes the tag that is being displayed in a given workspace.

Partial default:

(command: GotoTag,
value: "9",
modifier: ["modkey"],
key: "9")

Note: This command requires a value field to be specified.

ReturnToLastTag

Switch back to the last visited tag.

Example:

(command: ReturnToLastTag,
modifier: ["modkey"],
key: "n")

Note: This is only available in LeftWM >=0.3.0.

FocusNextTag

Moves the focus from the current tag to the next tag in a given workspace. An optional parameter can be specified to change the behavior of focusing. No value or default will simply move focus to the next tag, goto_used and ignore_empty will go to the next used tag, and goto_empty and ignore_used will go to the next empty tag.

Example:

(command: FocusNextTag, modifier: ["modkey"], key: "n"), // current default config
// (command: FocusNextTag, value: "default", modifier: ["modkey"], key: "n"), // same behaviour as no value
command: FocusNextTag, value: "goto_used", modifier: ["modkey", "Shift"], key: "n"), //same as value `ignore_empty`
(command: FocusNextTag, value: "goto_empty", modifier: ["modkey", "Alt"], key: "n"), //same as value `ignore_used`

FocusPreviousTag

Moves the focus from the current tag to the next tag in a given workspace. An optional behavioral parameter can be specified in the same way as with FocusNextTag.

Example:

(command: FocusPreviousTag, modifier: ["modkey"], key: "m"), // current default config
// (command: FocusPreviousTag, value: "default", modifier: ["modkey"], key: "m"), // same behaviour as no value
(command: FocusPreviousTag, value: "ignore_empty", modifier: ["modkey", "Shift"], key: "m"), //same as value `goto_used`
(command: FocusPreviousTag, value: "ignore_used", modifier: ["modkey", "Alt"], key: "m"), //same as value `goto_empty`        

SwapTags

Swaps the tags in the current workspace with the tags in the previous workspace.

Default:

(command: SwapTags,
modifier: ["modkey"],
key: "w")

IncreaseMainWidth

Increases the width of the main window.

Example:

(command: IncreaseMainWidth,
value: "5",
modifier: ["modkey"],
key: "a")

Note: This command requires a value field to be specified.

Note: This command does not apply to all layouts.

DecreaseMainWidth

Decreases the width of the main window.

Example:

(command: DecreaseMainWidth,
value: "5",
modifier: ["modkey"],
key: "x")

Note: This command requires a value field to be specified.

Note: This command does not apply to all layouts.

SetMarginMultiplier

Set the multiplier applied to the configured margin value.

Example:

(command: SetMarginMultiplier,
value: "2.5",
modifier: ["modkey"],
key: "m")

Note: This command requires a value field to be specified.

Note: The value needs to be a positive float, use "0.0" for no margins at all, use "1.0" to reset.

Note: This command does not apply to all layouts.

ToggleFullScreen

Toggles the currently focused window between full screen and not full screen.

Example:

(command: ToggleFullScreen,
modifier: ["modkey"],
key: "f")

Note: This is only available in LeftWM >=0.2.8.

ToggleSticky

Toggles the currently focused window between sticky and not sticky.

Example:

(command: ToggleSticky,
modifier: ["modkey"],
key: "v")

ToggleScratchPad

Toggles the specified scratchpad.

Example:

(command: ToggleScratchPad,
value: "Alacritty" /* Name set for the scratchpad */,
modifier: ["modkey"],
key: "p")

Note: This command requires a value field to be specified.

Note: This is only available in LeftWM >=0.2.8.

ReleaseScratchPad

Moves the window in a scratchpad to a tag and removes the empty scratchpad.

The value can be one of the following:

  • Empty or omitted: Use the currently focused scratchpad and the currently focused tag.
  • <tag id>: Move the currently focused scratchpad to the tag with <tag id>
  • <scratchpad name>: Move the window in the scratchpad with the name <scratchpad> to the current tag even if the scratchpad is not currently visible.

Example:

(command: ReleaseScratchPad, value: "Alacritty", modifier: ["modkey", "Control", "Shift"], key: "p"),

Another use case is to move the window in a scratchpad to a specific tag and removing the empty scratchpad in 1 keybinding:

(command: Execute, value: "leftwm-command \"ReleaseScratchPad\" \"SendWindowToTag 1\"", modifier: ["modkey", "Shift"], key: "1"),

AttachScratchPad

Attaches the currently selected window to a scratchpad. The value needs to be the name of the scratchpad to which the selected window will be attached. This command makes it possible to have more than 1 window in a scratchpad.

Example:

(command: AttachScratchPad, value: "Alacritty", modifier: ["modkey", "Shift"], key: "1"),

NextScratchPadWindow/PrevScratchPadWindow

Cycles through the scratchpad windows. The value needs to be a valid scratchpad name. Note that this command will be ignored if the given scratchpad is not visible.

Example:

(command: NextScratchPadWindow, value: "Alacritty", modifier: ["modkey", "Shift", "Control"], key: "comma"),
(command: PrevScratchPadWindow, value: "Alacritty", modifier: ["modkey", "Shift", "Control"], key: "period"),
Clone this wiki locally