Leftwm is my new preferred tiling window manager

Recently I've switched to Leftwm from i3wm just for fun and as a learning experience.

This post is for me, as a quick, always available, reference of my configuration in case i need to reinstall everything from scratch.
The first time, i did not get the logic behind Leftwm behaviour and caused me a lot of confusion, but this is because i never tried others dynamic tiling window managers before. The main difference between i3wm and Leftwm is that it (Leftwm) is born to manage big monitors (mainly wide ones) and multi-monitors setup out of the box and uses the concept of workspace (monitor) instead of the tag(virtual desktop) of i3wm.

My setup is based on Arch linux, so the name of the packages may be different if you try to install it on another Linux distro.

Fonts configuration and utils

yay -S ttf-blex-nerd-font-git
yay -S ttf-icomoon-feather
yay -S nerd-fonts-git
sudo pacman -S manjaro-pulse
sudo pacman -S jq autorandr xprop arandr

Configuration file

//  _        ___                                      ___ _
// | |      / __)_                                   / __|_)
// | | ____| |__| |_ _ _ _ ____      ____ ___  ____ | |__ _  ____    ____ ___  ____
// | |/ _  )  __)  _) | | |    \    / ___) _ \|  _ \|  __) |/ _  |  / ___) _ \|  _ \
// | ( (/ /| |  | |_| | | | | | |  ( (__| |_| | | | | |  | ( ( | |_| |  | |_| | | | |
// |_|\____)_|   \___)____|_|_|_|   \____)___/|_| |_|_|  |_|\_|| (_)_|   \___/|_| |_|
// A WindowManager for Adventurers                         (____/
// For info about configuration please visit https://github.com/leftwm/leftwm/wiki

#![enable(implicit_some)]
(
    modkey: "Mod4",
    mousekey: "Mod4",
    workspaces: [],
    tags: [
        "1 ﬐",
        "2 ",
        "3 ",
        "4 ",
        "5 ",
        "6 ",
        "7 ",
        "8 ",
        "9 ",
    ],
    max_window_width: None,
    layouts: [
        MainAndVertStack,
        MainAndHorizontalStack,
        MainAndDeck,
        Fibonacci,
        LeftMain,
        Monocle,
        RightWiderLeftStack,
        LeftWiderRightStack,
    ],
    layout_mode: Workspace,
    insert_behavior: Bottom,
    scratchpad: [
        (name: "Alacritty", value: "alacritty", x: 860, y: 390, height: 300, width: 200),
    ],
    window_rules: [
        ( window_class: "firefox", spawn_on_tag: 3 ),
        ( window_class: "Slack", spawn_on_tag: 1 ),
        ( window_class: "Google-chrome", spawn_on_tag: 3 ),
        ( window_class: "jetbrains-idea", spawn_on_tag: 7 ),
        ( window_class: "jetbrains-clion", spawn_on_tag: 7 ),
        ( window_class: "jetbrains-goland", spawn_on_tag: 7 ),
        ( window_class: "Standard Notes", spawn_on_tag: 5 ),
        ( window_class: "Typora", spawn_on_tag: 5 ),
        ( window_class: "Code", spawn_on_tag: 7 ),
        ( window_class: "1Password", spawn_on_tag: 8 ),
        ( window_class: "YoutubeMusic", spawn_on_tag: 6 ),
        ( window_class: "Microsoft-edge", spawn_on_tag: 3 ),
        ( window_class: "IRCCloud", spawn_on_tag: 1 ),
        ( window_class: "Element", spawn_on_tag: 1 ),
        ( window_class: "Pcmanfm", spawn_on_tag: 4),
        ( window_class: "Org.gnome.Nautilus", spawn_on_tag: 4),
    ],
    disable_current_tag_swap: false,
    disable_tile_drag: false,
    disable_window_snap: true,
    focus_behaviour: Sloppy,
    focus_new_windows: true,
    sloppy_mouse_follows_focus: true,
    keybind: [
        (command: Execute, value: "pavucontrol", modifier: ["modkey"], key: "a"),
        (command: Execute, value: "~/.screenlayout/home.sh", modifier: ["modkey", "Shift"], key: "m"),
        (command: Execute, value: "rofi -modi drun,run -show drun", modifier: ["modkey"], key: "p"),
        (command: Execute, value: "alacritty", modifier: ["modkey", "Shift"], key: "Return"),
        (command: CloseWindow, value: "", modifier: ["modkey", "Shift"], key: "q"),
        (command: SoftReload, value: "", modifier: ["modkey", "Shift"], key: "r"),
        (command: Execute, value: "loginctl kill-session $XDG_SESSION_ID", modifier: ["modkey", "Shift"], key: "x"),
        (command: Execute, value: "slock", modifier: ["modkey", "Control"], key: "l"),
        (command: Execute, value: "i3exit suspend", modifier: ["modkey", "Shift"], key: "s"),
        (command: Execute, value: "i3exit shutdown", modifier: ["modkey", "Control"], key: "s"),
        (command: MoveToLastWorkspace, value: "", modifier: ["modkey", "Shift"], key: "w"),
        (command: SwapTags, value: "", modifier: ["modkey"], key: "w"),
        (command: MoveWindowUp, value: "", modifier: ["modkey", "Shift"], key: "k"),
        (command: MoveWindowDown, value: "", modifier: ["modkey", "Shift"], key: "j"),
        (command: MoveWindowTop, value: "", modifier: ["modkey"], key: "Return"),
        (command: FocusWindowUp, value: "", modifier: ["modkey"], key: "k"),
        (command: FocusWindowDown, value: "", modifier: ["modkey"], key: "j"),
        (command: NextLayout, value: "", modifier: ["modkey", "Control"], key: "k"),
        (command: PreviousLayout, value: "", modifier: ["modkey", "Control"], key: "j"),
        (command: FocusWorkspaceNext, value: "", modifier: ["modkey"], key: "l"),
        (command: FocusWorkspacePrevious, value: "", modifier: ["modkey"], key: "h"),
        (command: MoveWindowUp, value: "", modifier: ["modkey", "Shift"], key: "Up"),
        (command: MoveWindowDown, value: "", modifier: ["modkey", "Shift"], key: "Down"),
        (command: FocusWindowUp, value: "", modifier: ["modkey"], key: "Up"),
        (command: FocusWindowDown, value: "", modifier: ["modkey"], key: "Down"),
        (command: NextLayout, value: "", modifier: ["modkey", "Control"], key: "Up"),
        (command: PreviousLayout, value: "", modifier: ["modkey", "Control"], key: "Down"),
        (command: FocusWorkspaceNext, value: "", modifier: ["modkey"], key: "Right"),
        (command: FocusWorkspacePrevious, value: "", modifier: ["modkey"], key: "Left"),
        (command: GotoTag, value: "1", modifier: ["modkey"], key: "1"),
        (command: GotoTag, value: "2", modifier: ["modkey"], key: "2"),
        (command: GotoTag, value: "3", modifier: ["modkey"], key: "3"),
        (command: GotoTag, value: "4", modifier: ["modkey"], key: "4"),
        (command: GotoTag, value: "5", modifier: ["modkey"], key: "5"),
        (command: GotoTag, value: "6", modifier: ["modkey"], key: "6"),
        (command: GotoTag, value: "7", modifier: ["modkey"], key: "7"),
        (command: GotoTag, value: "8", modifier: ["modkey"], key: "8"),
        (command: GotoTag, value: "9", modifier: ["modkey"], key: "9"),
        (command: MoveToTag, value: "1", modifier: ["modkey", "Shift"], key: "1"),
        (command: MoveToTag, value: "2", modifier: ["modkey", "Shift"], key: "2"),
        (command: MoveToTag, value: "3", modifier: ["modkey", "Shift"], key: "3"),
        (command: MoveToTag, value: "4", modifier: ["modkey", "Shift"], key: "4"),
        (command: MoveToTag, value: "5", modifier: ["modkey", "Shift"], key: "5"),
        (command: MoveToTag, value: "6", modifier: ["modkey", "Shift"], key: "6"),
        (command: MoveToTag, value: "7", modifier: ["modkey", "Shift"], key: "7"),
        (command: MoveToTag, value: "8", modifier: ["modkey", "Shift"], key: "8"),
        (command: MoveToTag, value: "9", modifier: ["modkey", "Shift"], key: "9"),
    ],
    state_path: None,
)

You'll only receive email when they publish something new.

More from Pietrangelo Masala
All posts