.{
    // environment variables
    // used by processes spawned by kwm
    .env = .{
        // .{ "key", "value" },
    },

    // working direction of processes spawned by kwm
    .working_directory = .home,

    .startup_cmds = .{
        .{ "sh", "/home/wball/.config/kwm/init.sh" },
    },

    // .none
    // or
    // .theme = .{ .name = []const u8, .size = u32 }
    .xcursor_theme = .none,

    // solid color background
    // note: set this to .none if you use other wallpaper program like `swaybg`, orelse it will be covered by this and unable to see
    // .background = .{ .color = 0x33000000 },
    .background = .none,

    .bar = .{
        .show_default = true,
        // .top
        // .bottom
        .position = .bottom,
        .font = "Iosevka Nerd Font:size=15",
        .color = .{
            .normal = .{
                .fg = 0xcdd6f4ff,
                .bg = 0x1e1e2eff,
            },
            .select = .{
                .fg = 0x1e1e2eff,
                .bg = 0xcdd6f4ff,
            },
        },
        .status = .stdin,
        // .status = .{ .text = "^#ff0000ffk^#00ff00ffw^#0000ffffm" }, // .stdin or .{ .fifo = "fifo file path" }, could use ^#RGBA to switch text color, and use ^#! to switch back to default color
        // bar clicked callback
        // each part supports left/right/middle/side/extra/forward/back/task
        // set .none to disable
        .click = .{
            .tags = .{
                // could use 0 there because it will be replace with the tag clicked
                .left = .{ .action = .{ .set_output_tag = .{ .tag = .{ .tag = 0 } } } },
                .right = .{ .action = .{ .toggle_output_tag = .{ .mask = 0 } } },
                .middle = .{ .action = .{ .toggle_window_tag = .{ .mask = 0 } } },
            },
            .layout = .{
                .left = .{ .action = .switch_to_previous_layout },
            },
            .mode = .{
                .left = .{ .action = .{ .switch_mode = .{ .mode = "default" } } },
            },
            .title = .{
                .left = .{ .action = .{ .zoom = .{ .swap = false } } },
            },
            .status = .{
                .middle = .{ .action = .{ .spawn = .{ .argv = .{"foot"} } } },
            },
        },
    },

    .sloppy_focus = false,

    // .none
    // .on_focus_changed: warp cursor to the center of window focused
    // .on_output_changed: warp cursor to the center of output focused
    .cursor_warp = .none,

    // if to remember last floating geometry
    .remember_floating_geometry = false,

    .auto_swallow = true,

    // .top: stack top
    // .bottom: stack bottom
    // .stack_top: for tile and deck layout
    // .above_focused
    // .below_focused
    .default_attach_mode = .{
        .tile = .top,
        .grid = .top,
        .monocle = .top,
        .deck = .stack_top,
        .scroller = .below_focused,
        .float = .top,
    },

    // .csd
    // .ssd
    .default_window_decoration = .ssd,

    // window border
    .border = .{
        .width = 3,
        .color = .{
            .focus = 0xf5c2e7ff,
            .unfocus = 0x586e75ff,
        },
    },

    // tags show on bar
    .tags = .{ "1", "2", "3", "4", "5", "6", "7", "8", "9" },

    // .tile
    // .grid
    // .monocle
    // .deck
    // .scroller
    // .float
    .default_layout = .tile,
    .layout = .{
        .tile = .{
            .nmaster = 1,
            .mfact = 0.55,
            .inner_gap = 12,
            .outer_gap = 9,

            // .left
            // .right
            // .top
            // .bottom
            .master_location = .left,
        },
        .grid = .{
            .outer_gap = 9,
            .inner_gap = 12,

            // .horizontal
            // .vertical
            .direction = .horizontal,
        },
        .monocle = .{
            .gap = 9,
        },
        .deck = .{
            .inner_gap = 12,
            .outer_gap = 9,

            // .left
            // .right
            // .top
            // .bottom
            .master_location = .left,
        },
        .scroller = .{
            .mfact = 0.5,
            .inner_gap = 16,
            .outer_gap = 9,
        },
    },

    // layout tags show on bar
    .layout_tag = .{
        .tile = .{
            .left = "[]=",
            .right = "=[]",
            .top = "[^]",
            .bottom = "[_]",
        },
        .grid = .{
            .horizontal = "|+|",
            .vertical = "|||",
        },
        .monocle = "[=]",
        .deck = .{
            .left = "[D]=",
            .right = "=[D]",
            .top = "[D^]",
            .bottom = "[D_]",
        },
        .scroller = "[==]",
        .float = "><>",
    },

    // key/pointer bindings
    .bindings = .{
        // repeat info for key repeat event, different with the repeat_info of input device
        .repeat_info = .{
            .rate = 50,
            .delay = 300,
        },

        // mode tags show on bar
        // display full mode string by default
        .mode_tag = .{
            .{ "default", "" }, // hide mode tag in default mode
            .{ "passthrough", "P" }, // only show "P" on bar in passthrough mode
            .{ "floating", "F" }, // only show "F" on bar in floating mode
        },

        // list of key bindings
        // full scheme:
        //       mode: string(< 16 bytes)
        //          "default" and "lock" are defined by default
        //          "default" is the default mode, if you not set `mode`, the binding will be seemed as "default" mode
        //          when the session locked, kwm will switch to "lock" mode
        //          you could define any other mode
        //       keysym: keysym string
        //       modifiers:
        //          a struct with fields: shift, ctrl, mod1, mod3, mod4, mod5, and all of these fields are `false` by default
        //          set modifiers to .{} means key binding without any modifier
        //       event: key binding trigger event
        //          there are two options:
        //              .event = .{
        //                  .repeat = action
        //              }
        //              after the key pressed, the action will repeatly trigger until key released or any another key pressed
        //
        //              .event = .{
        //                  .click = .{
        //                      .pressed = null or action, default is null
        //                      .released = null or action, default is null
        //                  }
        //              }
        //              the corrosponding action will only trigger once when key pressed or released
        //              the pressed action and released action could define at the same time
        .key = .{
            .{
                .keysym = "r",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .reload_config,
                    },
                },
            },

            // passthrough
            .{
                .keysym = "Escape",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_mode = .{ .mode = "passthrough" },
                        },
                    },
                },
            },
            .{
                .mode = "passthrough",
                .keysym = "Escape",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_mode = .{ .mode = "default" },
                        },
                    },
                },
            },

            // floating
            .{
                .keysym = "f",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_mode = .{ .mode = "floating", .auto_quit = .once_unbound_pressed },
                        },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "l",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .repeat = .{
                        .move = .{ .step = .{ .horizontal = 10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "h",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .repeat = .{
                        .move = .{ .step = .{ .horizontal = -10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "j",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .repeat = .{
                        .move = .{ .step = .{ .vertical = 10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "k",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .repeat = .{
                        .move = .{ .step = .{ .vertical = -10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "l",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .repeat = .{
                        .resize = .{ .step = .{ .horizontal = 10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "h",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .repeat = .{
                        .resize = .{ .step = .{ .horizontal = -10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "j",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .repeat = .{
                        .resize = .{ .step = .{ .vertical = 10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "k",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .repeat = .{
                        .resize = .{ .step = .{ .vertical = -10 } },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "l",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .snap = .{ .edge = .right },
                        },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "h",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .snap = .{ .edge = .left },
                        },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "j",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .snap = .{ .edge = .bottom },
                        },
                    },
                },
            },
            .{
                .mode = "floating",
                .keysym = "k",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .snap = .{ .edge = .top },
                        },
                    },
                },
            },

            // default
            .{
                .keysym = "q",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .quit = .{ .exit_session = true },
                        },
                    },
                },
            },
            .{
                .keysym = "c",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .close,
                    },
                },
            },
            .{
                .keysym = "c",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"/home/wball/.config/kwm/toggle_caffeine.sh"} },
                        },
                    },
                },
            },
            .{
                .keysym = "d",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "dunstctl", "close" } },
                        },
                    },
                },
            },
            .{
                .keysym = "Print",
                .modifiers = .{ .mod4 = false },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "/home/wball/.config/kwm/screenshot.sh", "clip" } },
                        },
                    },
                },
            },
            .{
                .keysym = "Print",
                .modifiers = .{ .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "/home/wball/.config/kwm/screenshot.sh", "menu" } },
                        },
                    },
                },
            },
            .{
                .keysym = "b",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "/home/wball/.config/kwm/bluetooth.sh", "--connect" } },
                        },
                    },
                },
            },
            .{
                .keysym = "b",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "/home/wball/.config/kwm/bluetooth.sh", "--disconnect" } },
                        },
                    },
                },
            },
            .{
                .keysym = "z",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"books.sh"} },
                        },
                    },
                },
            },
            .{
                .keysym = "y",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"papers.sh"} },
                        },
                    },
                },
            },
            .{
                .keysym = "e",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "emacsclient", "--create-frame", "--alternate-editor='emacs" } },
                        },
                    },
                },
            },
            .{
                .keysym = "p",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"/home/wball/.config/kwm/power_mode.sh"} },
                        },
                    },
                },
            },
            .{
                .keysym = "n",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "/home/wball/.config/kwm/pianobar.sh", "n" } },
                        },
                    },
                },
            },
            .{
                .keysym = "s",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"/home/wball/.config/pianobar/change_station.sh"} },
                        },
                    },
                },
            },
            .{
                .keysym = "p",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "/home/wball/.config/kwm/pianobar.sh", "p" } },
                        },
                    },
                },
            },
            .{
                .keysym = "c",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"/home/wball/.config/pianobar/display_info.sh"} },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86AudioRaiseVolume",
                .modifiers = .{
                    .mod4 = false,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "audio", "sink", "--plus" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86AudioLowerVolume",
                .modifiers = .{
                    .mod4 = false,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "audio", "sink", "--minus" } },
                            // .spawn = .{ .argv = .{ "/home/wball/.config/kwm/volume.sh", "down", "0.02" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86AudioRaiseVolume",
                .modifiers = .{
                    .shift = true,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "audio", "sink", "--plus10" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86AudioLowerVolume",
                .modifiers = .{
                    .shift = true,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "audio", "sink", "--minus10" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86AudioMute",
                .modifiers = .{
                    .ctrl = false,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "audio", "sink", "--mute" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86MonBrightnessUp",
                .modifiers = .{
                    .ctrl = false,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "bright", "--plus10" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86MonBrightnessDown",
                .modifiers = .{
                    .ctrl = false,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "bright", "--minus10" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86MonBrightnessUp",
                .modifiers = .{
                    .shift = true,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "bright", "--plus" } },
                        },
                    },
                },
            },
            .{
                .keysym = "XF86MonBrightnessDown",
                .modifiers = .{
                    .shift = true,
                },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{ "bright", "--minus" } },
                        },
                    },
                },
            },
            .{
                .keysym = "Return",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"foot"} },
                        },
                    },
                },
            },
            .{
                .keysym = "h",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .focus_master_return,
                    },
                },
            },
            .{
                .keysym = "l",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .focus_master_return,
                    },
                },
            },
            .{
                .keysym = "b",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .toggle_bar,
                    },
                },
            },
            .{
                .keysym = "j",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .focus_iter = .{ .direction = .forward },
                        },
                    },
                },
            },
            .{
                .keysym = "k",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .focus_iter = .{ .direction = .reverse },
                        },
                    },
                },
            },
            .{
                .keysym = "j",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .focus_iter = .{ .direction = .forward, .skip = .floating },
                        },
                    },
                },
            },
            .{
                .keysym = "k",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .focus_iter = .{ .direction = .reverse, .skip = .floating },
                        },
                    },
                },
            },
            .{
                .keysym = "j",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .swap = .{ .direction = .forward },
                        },
                    },
                },
            },
            .{
                .keysym = "k",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .swap = .{ .direction = .reverse },
                        },
                    },
                },
            },
            .{
                .keysym = "period",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .focus_output_iter = .{ .direction = .forward },
                        },
                    },
                },
            },
            .{
                .keysym = "comma",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .focus_output_iter = .{ .direction = .reverse },
                        },
                    },
                },
            },
            .{
                .keysym = "period",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .send_to_output = .{ .direction = .forward },
                        },
                    },
                },
            },
            .{
                .keysym = "comma",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .send_to_output = .{ .direction = .reverse },
                        },
                    },
                },
            },
            .{
                .keysym = "m",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .toggle_fullscreen = .{ .in_window = true },
                        },
                    },
                },
            },
            .{
                .keysym = "f",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .toggle_fullscreen = .{ .in_window = false },
                        },
                    },
                },
            },
            .{
                .keysym = "space",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .switch_to_previous_layout,
                    },
                },
            },
            .{
                .keysym = "f",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .toggle_floating,
                    },
                },
            },
            .{
                .keysym = "s",
                .modifiers = .{ .mod4 = true, .ctrl = true },
                .event = .{
                    .click = .{
                        .pressed = .toggle_sticky,
                    },
                },
            },
            .{
                .keysym = "a",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .toggle_swallow,
                    },
                },
            },
            .{
                .keysym = "f",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_layout = .{ .layout = .float },
                        },
                    },
                },
            },
            .{
                .keysym = "t",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_layout = .{ .layout = .tile },
                        },
                    },
                },
            },
            .{
                .keysym = "g",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_layout = .{ .layout = .grid },
                        },
                    },
                },
            },
            .{
                .keysym = "d",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_layout = .{ .layout = .deck },
                        },
                    },
                },
            },
            .{
                .keysym = "m",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_layout = .{ .layout = .monocle },
                        },
                    },
                },
            },
            .{
                .keysym = "s",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .switch_layout = .{ .layout = .scroller },
                        },
                    },
                },
            },
            .{
                .keysym = "Tab",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .switch_to_previous_tag,
                    },
                },
            },
            .{
                .keysym = "apostrophe",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .set_output_tag = .{ .tag = .{ .occupied = .forward } },
                        },
                    },
                },
            },
            // .{
            //     .keysym = "semicolon",
            //     .modifiers = .{ .mod4 = true },
            //     .event = .{
            //         .click = .{
            //             .pressed = .{
            //                 .set_output_tag = .{ .tag = .{ .occupied = .reverse } },
            //             },
            //         },
            //     },
            // },
            .{
                .keysym = "apostrophe",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .set_window_tag = .{ .tag = .{ .unoccupied = .forward } },
                        },
                    },
                },
            },
            // .{
            //     .keysym = "semicolon",
            //     .modifiers = .{ .mod4 = true, .shift = true },
            //     .event = .{
            //         .click = .{
            //             .pressed = .{
            //                 .set_window_tag = .{ .tag = .{ .unoccupied = .reverse } },
            //             },
            //         },
            //     },
            // },

            .{ .keysym = "1", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b1 } } } } } },
            .{ .keysym = "2", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b10 } } } } } },
            .{ .keysym = "3", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b100 } } } } } },
            .{ .keysym = "4", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b1000 } } } } } },
            .{ .keysym = "5", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b10000 } } } } } },
            .{ .keysym = "6", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b100000 } } } } } },
            .{ .keysym = "7", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b1000000 } } } } } },
            .{ .keysym = "8", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b10000000 } } } } } },
            .{ .keysym = "9", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b100000000 } } } } } },
            .{ .keysym = "0", .modifiers = .{ .mod4 = true }, .event = .{ .click = .{ .pressed = .{ .set_output_tag = .{ .tag = .{ .tag = 0b111111111 } } } } } },

            .{ .keysym = "1", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b1 } } } } },
            .{ .keysym = "2", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b10 } } } } },
            .{ .keysym = "3", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b100 } } } } },
            .{ .keysym = "4", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b1000 } } } } },
            .{ .keysym = "5", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b10000 } } } } },
            .{ .keysym = "6", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b100000 } } } } },
            .{ .keysym = "7", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b1000000 } } } } },
            .{ .keysym = "8", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b10000000 } } } } },
            .{ .keysym = "9", .modifiers = .{ .mod4 = true, .ctrl = true }, .event = .{ .click = .{ .pressed = .{ .toggle_output_tag = .{ .mask = 0b100000000 } } } } },

            .{ .keysym = "1", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b1 } } } } } },
            .{ .keysym = "2", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b10 } } } } } },
            .{ .keysym = "3", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b100 } } } } } },
            .{ .keysym = "4", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b1000 } } } } } },
            .{ .keysym = "5", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b10000 } } } } } },
            .{ .keysym = "6", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b100000 } } } } } },
            .{ .keysym = "7", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b1000000 } } } } } },
            .{ .keysym = "8", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b10000000 } } } } } },
            .{ .keysym = "9", .modifiers = .{ .mod4 = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .set_window_tag = .{ .tag = .{ .tag = 0b100000000 } } } } } },

            .{ .keysym = "1", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b1 } } } } },
            .{ .keysym = "2", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b10 } } } } },
            .{ .keysym = "3", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b100 } } } } },
            .{ .keysym = "4", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b1000 } } } } },
            .{ .keysym = "5", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b10000 } } } } },
            .{ .keysym = "6", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b100000 } } } } },
            .{ .keysym = "7", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b1000000 } } } } },
            .{ .keysym = "8", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b10000000 } } } } },
            .{ .keysym = "9", .modifiers = .{ .mod4 = true, .ctrl = true, .shift = true }, .event = .{ .click = .{ .pressed = .{ .toggle_window_tag = .{ .mask = 0b100000000 } } } } },

            .{
                .keysym = "l",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_mfact = .{ .step = 0.01 },
                        },
                    },
                },
            },
            .{
                .keysym = "h",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_mfact = .{ .step = -0.01 },
                        },
                    },
                },
            },
            .{
                .keysym = "j",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_master_location = .{ .location = .bottom },
                        },
                    },
                },
            },
            .{
                .keysym = "k",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_master_location = .{ .location = .top },
                        },
                    },
                },
            },
            .{
                .keysym = "l",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_master_location = .{ .location = .right },
                        },
                    },
                },
            },
            .{
                .keysym = "h",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_master_location = .{ .location = .left },
                        },
                    },
                },
            },
            .{
                .keysym = "equal",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_nmaster = .{ .change = .increase },
                        },
                    },
                },
            },
            .{
                .keysym = "minus",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_nmaster = .{ .change = .decrease },
                        },
                    },
                },
            },
            .{
                .keysym = "equal",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_gap = .{ .step = 1 },
                        },
                    },
                },
            },
            .{
                .keysym = "minus",
                .modifiers = .{ .mod4 = true, .mod1 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .modify_gap = .{ .step = -1 },
                        },
                    },
                },
            },
            .{
                .keysym = "a",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .toggle_auto_swallow,
                    },
                },
            },
            .{
                .keysym = "g",
                .modifiers = .{ .mod4 = true, .shift = true },
                .event = .{
                    .click = .{
                        .pressed = .toggle_grid_direction,
                    },
                },
            },
            .{
                .keysym = "BracketRight",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn_shell = .{ .cmd = "librewolf" },
                        },
                    },
                },
            },
            .{
                .keysym = "semicolon",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn_shell = .{ .cmd = "bemenu-run" },
                        },
                    },
                },
            },
            .{
                .keysym = "Return",
                .modifiers = .{ .mod4 = true },
                .event = .{
                    .click = .{
                        .pressed = .{
                            .spawn = .{ .argv = .{"footclient"} },
                        },
                    },
                },
            },
        },

        // list of pointer bindings
        // full scheme:
        //       mode: same as key binding
        //       button: pointer button
        //          .left
        //          .right
        //          .middle
        //       modifiers: same as key binding
        //       event: pointer binding trigger event
        //              .event = .{
        //                  .pressed = null or action, default is null
        //                  .released = null or action, default is null
        //              }
        //              the corrosponding action will only trigger once when pointer button pressed or released
        //              the pressed action and released action could define at the same time
        .pointer = .{
            .{
                .mode = "default",
                .button = .left,
                .modifiers = .{ .mod4 = true },
                .event = .{ .pressed = .pointer_move },
            },
            .{
                .mode = "default",
                .button = .right,
                .modifiers = .{ .mod4 = true },
                .event = .{ .pressed = .pointer_resize },
            },
        },
        // other unmentioned actions:
        //      group: run multiple actions in sequence
        //         .event = .{
        //             .click = .{
        //                 .pressed = .{
        //                     .group = .{
        //                         .actions = .{
        //                             action1,
        //                             action2,
        //                             ...
        //                         },
        //                     },
        //                 },
        //             },
        //         }
    },

    // rule part
    //
    // a rule pattern has fields below:
    //      str: pattern string, required
    //      regex: bool, if enable regex
    //      match_null: bool, if match null
    //
    // only the first rule matched will be applied

    // window rules
    // full scheme:
    //      app_id: rule pattern
    //      title: rule pattern
    //
    //      tag: window tag
    //      output: output name pattern, same as rule pattern
    //      floating: bool, if floating
    //      dimension: .{ .width = i32, .height = i32 }, initial dimension
    //      decoration: .csd or .ssd, window decoration
    //      is_terminal: bool, if set true, means the window could be swallowed
    //      disable_swallow: bool, if set true, the window could not swallow any other windows
    //      scroller_mfact: f32, initial mfact of the window for scroller layout
    //      attach_mode: like `default_attach_mode`, change attach_mode for window matched
    .window_rules = .{
        .{ .app_id = .{ .str = "", .match_null = true }, .floating = true },
        .{ .app_id = .{ .str = "zenity" }, .floating = true },
        .{ .app_id = .{ .str = "DesktopEditors" }, .floating = true },
        .{ .app_id = .{ .str = "xdg-desktop-portal-gtk" }, .floating = true },
        .{ .app_id = .{ .str = "chromium" }, .tag = 0b10, .scroller_mfact = 0.9 },
        .{ .app_id = .{ .str = "foot" }, .is_terminal = true, .scroller_mfact = 0.8 },
    },

    // output rules
    // full scheme:
    //      name: rule pattern
    //
    //      presentation_mode: presentation mode, .vsync or .async
    //      layout: same as `layout` before but you only need to specify the values you want to change
    //      default_layout: same as `default_layout` before
    .output_rules = .{
        //
    },

    // input device rules
    // full scheme:
    //      name: rule pattern
    //
    //      repeat_info: .{ .rate = i32, .delay = i32 }
    //      scroll_factor: f64
    .input_device_rules = .{
        .{ .repeat_info = .{ .rate = 50, .delay = 300 } },
    },

    // libinput device rules
    // full scheme:
    //      name: rule pattern
    //
    //      send_events_modes:
    //          .enabled
    //          .disabled
    //          .disabled_on_external_mouse
    //      tap: .enabled or .disabled
    //      drag: .enabled or .disabled
    //      drag_lock: .enabled or .disabled
    //      tap_button_map: .lrm or .lmr
    //      three_finger_drag:
    //          .disabled
    //          .enabled_3fg
    //          .enabled_4fg
    //      calibration_matrix: [6]f32
    //      accel_profile:
    //          .none
    //          .flat
    //          .adaptive
    //          .custom
    //      accel_speed: f32
    //      natural_scroll: .enabled or .disabled
    //      left_handed: .enabled or .disabled
    //      click_method:
    //          .none
    //          .button_areas
    //          .clickfinger
    //      clickfinger_button_map: .lrm or .lmr
    //      middle_button_emulation: .enabled or .disabled
    //      scroll_method:
    //          .no_scroll
    //          .two_finger
    //          .edge
    //          .on_button_down
    //      scroll_button:
    //          .left
    //          .right
    //          .middle
    //      scroll_button_lock: .enabled or .disabled
    //      disable_while_typing: .enabled or .disabled
    //      disable_while_trackpointing: .enabled or .disabled
    //      rotation_angle: u32
    .libinput_device_rules = .{ .{ .name = .{ .str = ".*[tT]ouchpad", .regex = true }, .tap = .enabled, .drag = .enabled, .natural_scroll = .enabled }, .{ .tap = .enabled, .drag = .enabled } },

    // xkb_keyboard rules
    // full scheme:
    //      name: rule pattern
    //
    //      numlock: .enabled or .disabled
    //      capslock: .enabled or .disabled
    //      layout:
    //          layout index: .{ .index = u32 }
    //          or
    //          layout name: .{ .name = "layout name" }
    //      keymap:
    //          .{ .file = .{ .path = "keymap file path", .format = .text_v1 or .text_v2 } }
    //          or
    //          .{
    //              .options = .{
    //                  .rules = ?[]const u8,
    //                  .model = ?[]const u8,
    //                  .layout = ?[]const u8,
    //                  .variant = ?[]const u8,
    //                  .options = ?[]const u8,
    //              }
    //          }
    .xkb_keyboard_rules = .{
        .{
            .keymap = .{
                .options = .{
                    .layout = "us",
                    .variant = "colemak_dh",
                },
            },
        },
    },
}
