### Configure OXWM with Lua Source: https://context7.com/tonybanters/oxwm/llms.txt A complete configuration example covering color palettes, window rules, keybindings, and status bar setup. ```lua ---@module 'oxwm' -- Color palette local colors = { fg = "#bbbbbb", bg = "#1a1b26", red = "#f7768e", green = "#9ece6a", blue = "#6dade3", cyan = "#0db9d7", purple = "#ad8ee6", lavender = "#a9b1d6", } local modkey = "Mod4" local terminal = "alacritty" local tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9" } -- Basic settings oxwm.set_terminal(terminal) oxwm.set_modkey(modkey) oxwm.set_tags(tags) oxwm.set_floating_position("center") -- Appearance oxwm.border.set_width(2) oxwm.border.set_focused_color(colors.blue) oxwm.border.set_unfocused_color(colors.fg) oxwm.gaps.set_smart(true) oxwm.gaps.set_inner(5, 5) oxwm.gaps.set_outer(5, 5) -- Layouts oxwm.set_layout_symbol("tiling", "[]=") oxwm.set_layout_symbol("normie", "><>") -- Status bar oxwm.bar.set_font("monospace:style=Bold:size=10") oxwm.bar.set_scheme_normal(colors.fg, colors.bg, "#444444") oxwm.bar.set_scheme_occupied(colors.cyan, colors.bg, colors.cyan) oxwm.bar.set_scheme_selected(colors.cyan, colors.bg, colors.purple) oxwm.bar.set_blocks({ oxwm.bar.block.ram({ format = "RAM: {used}GB", interval = 5, color = colors.blue, underline = true }), oxwm.bar.block.datetime({ format = "{}", date_format = "%H:%M", interval = 60, color = colors.cyan, underline = true }), }) -- Window rules oxwm.rule.add({ instance = "gimp", floating = true }) oxwm.rule.add({ class = "firefox", tag = 2 }) -- Keybindings oxwm.key.bind({ modkey }, "Return", oxwm.spawn_terminal()) oxwm.key.bind({ modkey }, "D", oxwm.spawn("dmenu_run")) oxwm.key.bind({ modkey }, "Q", oxwm.client.kill()) oxwm.key.bind({ modkey }, "J", oxwm.client.focus_stack(1)) oxwm.key.bind({ modkey }, "K", oxwm.client.focus_stack(-1)) oxwm.key.bind({ modkey, "Shift" }, "J", oxwm.client.move_stack(1)) oxwm.key.bind({ modkey, "Shift" }, "K", oxwm.client.move_stack(-1)) oxwm.key.bind({ modkey }, "H", oxwm.set_master_factor(-5)) oxwm.key.bind({ modkey }, "L", oxwm.set_master_factor(5)) oxwm.key.bind({ modkey }, "N", oxwm.layout.cycle()) oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.restart()) oxwm.key.bind({ modkey, "Shift" }, "Q", oxwm.quit()) -- Tag keybindings (1-9) for i = 1, 9 do oxwm.key.bind({ modkey }, tostring(i), oxwm.tag.view(i - 1)) oxwm.key.bind({ modkey, "Shift" }, tostring(i), oxwm.tag.move_to(i - 1)) end -- Autostart oxwm.autostart("picom") oxwm.autostart("feh --bg-scale ~/wallpaper.jpg") ``` -------------------------------- ### Autostart API Source: https://context7.com/tonybanters/oxwm/llms.txt Function to execute commands automatically when OXWM starts. ```APIDOC ## Autostart API ### Description Run commands automatically when OXWM starts. ### Methods - **oxwm.autostart(command_string)**: Executes the provided command string on startup. ``` -------------------------------- ### Configure Autostart Applications Source: https://context7.com/tonybanters/oxwm/llms.txt Specify commands or applications to run automatically when OXWM starts. This includes launching background services, setting wallpapers, and starting compositors with specific options. ```lua -- Single command autostart oxwm.autostart("picom") oxwm.autostart("dunst") oxwm.autostart("nm-applet") -- Set wallpaper oxwm.autostart("feh --bg-scale ~/wallpaper.jpg") oxwm.autostart("nitrogen --restore") -- Start compositor with options oxwm.autostart("picom --backend glx --vsync") -- Shell commands oxwm.autostart("sh -c 'xset r rate 300 50'") ``` -------------------------------- ### Configure OXWM with Lua Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Example configuration demonstrating the functional API for setting keys, gaps, borders, and status bar blocks. ```lua -- Set basic options oxwm.set_terminal("st") oxwm.set_modkey("Mod4") oxwm.set_tags({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }) -- Configure borders oxwm.border.set_width(2) oxwm.border.set_focused_color("#6dade3") oxwm.border.set_unfocused_color("#bbbbbb") -- Configure gaps oxwm.gaps.set_enabled(true) oxwm.gaps.set_inner(5, 5) -- horizontal, vertical oxwm.gaps.set_outer(5, 5) -- Set up keybindings oxwm.key.bind({ "Mod4" }, "Return", oxwm.spawn("st")) oxwm.key.bind({ "Mod4" }, "Q", oxwm.client.kill()) oxwm.key.bind({ "Mod4", "Shift" }, "Q", oxwm.quit()) -- Add status bar blocks oxwm.bar.set_blocks({ oxwm.bar.block.datetime({ format = "{}", date_format = "%H:%M", interval = 60, color = "#0db9d7", underline = true, }), oxwm.bar.block.ram({ format = "RAM: {used}/{total} GB", interval = 5, color = "#7aa2f7", underline = true, }), }) ``` -------------------------------- ### Install OXWM on Arch Linux Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Use the AUR package to install OXWM and automatically register the desktop session. ```sh yay -S oxwm-git ``` -------------------------------- ### Start OXWM Session Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Commands to initiate the window manager session via .xinitrc or startx. ```sh exec oxwm ``` ```sh startx ``` -------------------------------- ### Install Dependencies Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Required system packages for building OXWM from source on Arch-based systems. ```sh sudo pacman -S zig libx11 libxft freetype2 fontconfig libxinerama ``` -------------------------------- ### OXWM Command Line Interface Source: https://context7.com/tonybanters/oxwm/llms.txt Utilize OXWM's command-line options for initialization, configuration management, and validation. Options include showing help, version, initializing a default config, specifying a custom config file, and validating the config without starting the WM. ```bash # Show help oxwm --help # Show version oxwm --version # Create default config at ~/.config/oxwm/config.lua oxwm --init # Use custom config file oxwm --config /path/to/config.lua # Validate config without starting WM oxwm --validate oxwm --validate /path/to/config.lua ``` -------------------------------- ### Testing OXWM with Xephyr Source: https://context7.com/tonybanters/oxwm/llms.txt Test OXWM in a nested X server environment using Xephyr without impacting your current session. Options include building and running for single or multi-monitor setups, manual Xephyr setup, and using Xwayland. ```bash # Build and run in Xephyr (single monitor) zig build xephyr # Build and run in Xephyr (multi-monitor) zig build xephyr-multi # Manual Xephyr setup Xephyr -screen 1280x800 :2 & DISPLAY=:2 zig build run # Using Xwayland zig build xwayland ``` -------------------------------- ### Initialize Development Environment Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Commands to clone the repository and enter the Nix development shell. ```sh # Clone the repository git clone https://github.com/tonybanters/oxwm cd oxwm # Enter the development environment nix develop ``` -------------------------------- ### Initialize Configuration Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Command to generate the default configuration file if it does not exist. ```sh oxwm --init ``` -------------------------------- ### Build from Source Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Commands to clone and build the project. Use the BSD-specific method if linker issues occur. ```sh git clone https://github.com/tonybanters/oxwm cd oxwm zig build ``` ```sh git clone https://github.com/tonybanters/oxwm cd oxwm zig build -Doptimize=ReleaseSmall --prefix /usr ``` -------------------------------- ### Command Line Interface Source: https://context7.com/tonybanters/oxwm/llms.txt CLI options for initialization and validation of the OXWM configuration. ```APIDOC ## Command Line Interface ### Description OXWM provides command-line options for initialization and validation. ### Commands - **--help**: Show help. - **--version**: Show version. - **--init**: Create default config at ~/.config/oxwm/config.lua. - **--config [path]**: Use custom config file. - **--validate [path]**: Validate config without starting WM. ``` -------------------------------- ### Configure basic window manager settings Source: https://context7.com/tonybanters/oxwm/llms.txt Define terminal commands, modifier keys, workspace tags, and layout behaviors. ```lua -- Set the terminal emulator command oxwm.set_terminal("alacritty") -- Alternative terminals: "st", "kitty", "xterm" -- Set the modifier key for keybindings -- "Mod4" is Super/Windows key, "Mod1" is Alt oxwm.set_modkey("Mod4") -- Define workspace tags (supports text, numbers, or Nerd Font icons) oxwm.set_tags({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }) -- Icon example: { "", "󰊯", "", "", "󰙯", "󱇤", "", "󱘶", "󰧮" } -- Set default layout for all tags -- Options: "tiling", "floating"/"normie", "monocle", "grid", "scrolling" oxwm.set_layout("tiling") -- Set default layout for a specific tag (tag index 1-9) oxwm.set_tag_layout(1, "grid") oxwm.set_tag_layout(9, "floating") -- Set custom symbols for layouts (displayed in status bar) oxwm.set_layout_symbol("tiling", "[T]") oxwm.set_layout_symbol("normie", "[F]") oxwm.set_layout_symbol("monocle", "[M]") oxwm.set_layout_symbol("grid", "[#]") -- Set where floating windows spawn -- Options: "center", "top-left", "top-right", "bottom-left", "bottom-right" oxwm.set_floating_position("center") ``` -------------------------------- ### Define Window Rules Source: https://context7.com/tonybanters/oxwm/llms.txt Automatically configure window properties like floating, tag assignment, and focus based on window class, instance, or title. Use 'xprop' to identify window properties. ```lua -- Rule format: add({ match_criteria, window_properties }) -- Use xprop to find window class/instance: WM_CLASS(STRING) = "instance", "class" -- Force GIMP to float oxwm.rule.add({ instance = "gimp", floating = true }) -- Send Firefox to tag 2 oxwm.rule.add({ class = "firefox", tag = 2 }) -- Float Firefox's download dialog oxwm.rule.add({ class = "firefox", title = "Library", floating = true }) -- Send terminal to tag 9 and focus it oxwm.rule.add({ class = "Alacritty", tag = 9, focus = true }) -- Float mpv player oxwm.rule.add({ instance = "mpv", floating = true }) -- Multiple rules example oxwm.rule.add({ class = "Spotify", tag = 8 }) oxwm.rule.add({ class = "Discord", tag = 7 }) oxwm.rule.add({ class = "Steam", floating = true }) ``` -------------------------------- ### Configure Multi-Monitor Support Source: https://context7.com/tonybanters/oxwm/llms.txt Focus and move windows between connected monitors using relative indices. ```lua -- Focus adjacent monitor (-1 = previous, 1 = next) oxwm.key.bind({ "Mod4" }, "Comma", oxwm.monitor.focus(-1)) oxwm.key.bind({ "Mod4" }, "Period", oxwm.monitor.focus(1)) -- Send focused window to adjacent monitor oxwm.key.bind({ "Mod4", "Shift" }, "Comma", oxwm.monitor.tag(-1)) oxwm.key.bind({ "Mod4", "Shift" }, "Period", oxwm.monitor.tag(1)) ``` -------------------------------- ### Basic Settings API Source: https://context7.com/tonybanters/oxwm/llms.txt Configure fundamental window manager settings including terminal emulator, modifier key, and workspace tags. ```APIDOC ## Basic Settings API ### Description Configure fundamental window manager settings including terminal emulator, modifier key, and workspace tags. ### Method N/A (Configuration script) ### Endpoint N/A (Configuration script) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua -- Set the terminal emulator command oxwm.set_terminal("alacritty") -- Set the modifier key for keybindings oxwm.set_modkey("Mod4") -- Define workspace tags oxwm.set_tags({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }) -- Set default layout for all tags oxwm.set_layout("tiling") -- Set default layout for a specific tag (tag index 1-9) oxwm.set_tag_layout(1, "grid") -- Set custom symbols for layouts oxwm.set_layout_symbol("tiling", "[T]") -- Set where floating windows spawn oxwm.set_floating_position("center") ``` ### Response #### Success Response (200) N/A (Configuration changes are applied directly) #### Response Example N/A ``` -------------------------------- ### Test OXWM with Xephyr Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Commands to launch OXWM in a nested X server session for testing purposes. ```sh zig build xephyr ``` ```sh zig build xephyr-multi ``` ```sh Xephyr -screen 1280x800 :2 & DISPLAY=:2 zig build run ``` -------------------------------- ### Build and Test OXWM Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Standard command to compile the project with release optimizations. ```sh zig build -Doptimize=ReleaseSmall ``` -------------------------------- ### View Project Directory Structure Source: https://github.com/tonybanters/oxwm/blob/master/readme.org The file hierarchy of the OXWM source code repository. ```sh src/ ├── main.zig [Entry point - handles CLI args, config loading, WM init] ├── client.zig [Client/window management] ├── monitor.zig [Monitor handling and multi-monitor support] ├── overlay.zig [Overlay rendering] ├── animations.zig [Animation support] │ ├── config/ │ ├── config.zig [Config struct and defaults] │ └── lua.zig [Lua config parser - loads and executes config.lua] │ ├── bar/ │ ├── bar.zig [Status bar with XFT support] │ └── blocks/ │ ├── blocks.zig [Block system core] │ ├── format.zig [Block formatting utilities] │ ├── battery.zig [Battery status block] │ ├── datetime.zig [Date/time formatting block] │ ├── ram.zig [RAM usage block] │ ├── cpu_temp.zig [CPU temperature block] │ ├── shell.zig [Shell command execution block] │ └── static.zig [Static text block] │ ├── layouts/ │ ├── tiling.zig [Tiling layout with master/stack] │ ├── monocle.zig [Fullscreen stacking layout] │ ├── floating.zig [Floating layout] │ └── scrolling.zig [Scrolling layout] │ └── x11/ ├── xlib.zig [X11/Xlib bindings] ├── display.zig [Display management] └── events.zig [X11 event handling] templates/ ├── config.lua [Default config with functional API] └── oxwm.lua [LSP type definitions for autocomplete] ``` -------------------------------- ### Enable OXWM on NixOS Source: https://github.com/tonybanters/oxwm/blob/master/readme.org Add this configuration to your NixOS system configuration file to enable the OXWM service. ```nix { config, pkgs, ... }: { services.xserver.windowManager.oxwm.enable = true; } ``` -------------------------------- ### Configure Keybindings Source: https://context7.com/tonybanters/oxwm/llms.txt Bind key combinations to window manager actions using modifiers like Mod4 or Shift. Keys should be specified as uppercase letters or special names. ```lua -- Basic keybinding format: bind({modifiers}, key, action) -- Modifiers: "Mod4" (Super), "Mod1" (Alt), "Shift", "Control" -- Keys: Use uppercase for letters, special names for others -- Spawn terminal (uses configured terminal emulator) oxwm.key.bind({ "Mod4" }, "Return", oxwm.spawn_terminal()) -- Spawn custom command oxwm.key.bind({ "Mod4" }, "D", oxwm.spawn("dmenu_run")) oxwm.key.bind({ "Mod4" }, "D", oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" })) -- Window management oxwm.key.bind({ "Mod4" }, "Q", oxwm.client.kill()) oxwm.key.bind({ "Mod4", "Shift" }, "Space", oxwm.client.toggle_floating()) oxwm.key.bind({ "Mod4", "Shift" }, "F", oxwm.client.toggle_fullscreen()) -- Focus navigation (1 = next, -1 = previous) oxwm.key.bind({ "Mod4" }, "J", oxwm.client.focus_stack(1)) oxwm.key.bind({ "Mod4" }, "K", oxwm.client.focus_stack(-1)) -- Window movement in stack oxwm.key.bind({ "Mod4", "Shift" }, "J", oxwm.client.move_stack(1)) oxwm.key.bind({ "Mod4", "Shift" }, "K", oxwm.client.move_stack(-1)) -- Master area controls (tiling layout) oxwm.key.bind({ "Mod4" }, "H", oxwm.set_master_factor(-5)) -- Decrease width oxwm.key.bind({ "Mod4" }, "L", oxwm.set_master_factor(5)) -- Increase width oxwm.key.bind({ "Mod4" }, "I", oxwm.inc_num_master(1)) -- More masters oxwm.key.bind({ "Mod4" }, "P", oxwm.inc_num_master(-1)) -- Fewer masters -- Layout management oxwm.key.bind({ "Mod4" }, "N", oxwm.layout.cycle()) oxwm.key.bind({ "Mod4" }, "C", oxwm.layout.set("tiling")) oxwm.key.bind({ "Mod4" }, "F", oxwm.layout.set("normie")) -- Toggles oxwm.key.bind({ "Mod4" }, "A", oxwm.toggle_gaps()) oxwm.key.bind({ "Mod4" }, "B", oxwm.toggle_bar()) -- WM control oxwm.key.bind({ "Mod4", "Shift" }, "R", oxwm.restart()) oxwm.key.bind({ "Mod4", "Shift" }, "Q", oxwm.quit()) oxwm.key.bind({ "Mod4", "Shift" }, "Slash", oxwm.show_keybinds()) ``` -------------------------------- ### Configure window gaps Source: https://context7.com/tonybanters/oxwm/llms.txt Manage inner and outer spacing between windows and screen edges. ```lua -- Enable or disable gaps oxwm.gaps.set_enabled(true) -- Enable smart gaps (no border/gaps when only one window visible) oxwm.gaps.set_smart(true) -- Set inner gaps (between windows) in pixels -- Parameters: horizontal, vertical oxwm.gaps.set_inner(5, 5) -- Set outer gaps (between windows and screen edges) in pixels -- Parameters: horizontal, vertical oxwm.gaps.set_outer(10, 10) -- Example: Asymmetric gaps configuration oxwm.gaps.set_enabled(true) oxwm.gaps.set_smart(false) oxwm.gaps.set_inner(8, 6) -- 8px horizontal, 6px vertical between windows oxwm.gaps.set_outer(12, 8) -- 12px horizontal, 8px vertical from edges ``` -------------------------------- ### Keybinding API Source: https://context7.com/tonybanters/oxwm/llms.txt Configure key combinations to trigger various window manager actions. Supports modifiers like Mod4, Shift, and Control, along with specific key names. ```APIDOC ## Keybinding API Bind key combinations to window manager actions using modifiers and key names. ### Description This API allows users to define custom keyboard shortcuts for executing specific window manager functions. ### Method `oxwm.key.bind(modifiers, key, action)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **modifiers** (table) - Required - A list of modifier keys (e.g., `"Mod4"`, `"Shift"`). - **key** (string) - Required - The key to bind (e.g., `"Return"`, `"D"`). - **action** (function) - Required - The function to execute when the key combination is pressed. ### Request Example ```lua oxwm.key.bind({ "Mod4" }, "Return", oxwm.spawn_terminal()) oxwm.key.bind({ "Mod4", "Shift" }, "Space", oxwm.client.toggle_floating()) ``` ### Response No direct response, actions are executed immediately. #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Configure window border appearance Source: https://context7.com/tonybanters/oxwm/llms.txt Adjust border width and colors for focused and unfocused window states. ```lua -- Set border width in pixels oxwm.border.set_width(2) -- Set focused window border color (hex string or integer) oxwm.border.set_focused_color("#6dade3") -- Alternative: oxwm.border.set_focused_color(0x6dade3) -- Set unfocused window border color oxwm.border.set_unfocused_color("#444444") -- Example: Complete border configuration with color palette local colors = { blue = "#6dade3", grey = "#bbbbbb", } oxwm.border.set_width(3) oxwm.border.set_focused_color(colors.blue) oxwm.border.set_unfocused_color(colors.grey) ``` -------------------------------- ### Manage Tags and Workspaces Source: https://context7.com/tonybanters/oxwm/llms.txt Navigate between workspaces and manipulate window visibility across tags using 0-indexed identifiers. ```lua -- View/switch to specific tag (0-indexed) oxwm.key.bind({ "Mod4" }, "1", oxwm.tag.view(0)) oxwm.key.bind({ "Mod4" }, "2", oxwm.tag.view(1)) oxwm.key.bind({ "Mod4" }, "9", oxwm.tag.view(8)) -- Move focused window to tag oxwm.key.bind({ "Mod4", "Shift" }, "1", oxwm.tag.move_to(0)) oxwm.key.bind({ "Mod4", "Shift" }, "2", oxwm.tag.move_to(1)) -- Toggle viewing multiple tags at once (combo view) -- Example: On tag 1, press Mod+Ctrl+2 to see both tags 1 and 2 oxwm.key.bind({ "Mod4", "Control" }, "1", oxwm.tag.toggleview(0)) oxwm.key.bind({ "Mod4", "Control" }, "2", oxwm.tag.toggleview(1)) -- Make window visible on multiple tags (sticky window) -- Example: Window appears on both current tag and tag 2 oxwm.key.bind({ "Mod4", "Control", "Shift" }, "2", oxwm.tag.toggletag(1)) -- Navigate to adjacent tags oxwm.key.bind({ "Mod4" }, "Left", oxwm.tag.view_previous()) oxwm.key.bind({ "Mod4" }, "Right", oxwm.tag.view_next()) -- Navigate to adjacent non-empty tags oxwm.key.bind({ "Mod4", "Shift" }, "Left", oxwm.tag.view_previous_nonempty()) oxwm.key.bind({ "Mod4", "Shift" }, "Right", oxwm.tag.view_next_nonempty()) -- Enable tag back-and-forth (pressing current tag switches to previous) oxwm.tag.set_back_and_forth(true) ``` -------------------------------- ### Define Keychords Source: https://context7.com/tonybanters/oxwm/llms.txt Create multi-key sequences for complex actions, similar to Emacs or Vim keybindings. ```lua -- Keychord format: chord({{modifiers, key1}, {modifiers, key2}}, action) -- Press Mod4+Space, release, then press T to spawn terminal oxwm.key.chord({ { { "Mod4" }, "Space" }, { {}, "T" } }, oxwm.spawn_terminal()) -- Emacs-style prefix keybinds -- Mod4+Space -> A = toggle gaps oxwm.key.chord({ { { "Mod4" }, "Space" }, { {}, "A" } }, oxwm.toggle_gaps()) -- Mod4+Space -> L -> T = set tiling layout oxwm.key.chord({ { { "Mod4" }, "Space" }, { {}, "L" }, { {}, "T" } }, oxwm.layout.set("tiling")) ``` -------------------------------- ### Gaps Configuration API Source: https://context7.com/tonybanters/oxwm/llms.txt Configure inner and outer gaps between windows with smart gap support. ```APIDOC ## Gaps Configuration API ### Description Configure inner and outer gaps between windows with smart gap support. ### Method N/A (Configuration script) ### Endpoint N/A (Configuration script) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua -- Enable or disable gaps oxwm.gaps.set_enabled(true) -- Enable smart gaps oxwm.gaps.set_smart(true) -- Set inner gaps (horizontal, vertical) oxwm.gaps.set_inner(5, 5) -- Set outer gaps (horizontal, vertical) oxwm.gaps.set_outer(10, 10) -- Example: Asymmetric gaps configuration oxwm.gaps.set_enabled(true) oxwm.gaps.set_smart(false) oxwm.gaps.set_inner(8, 6) oxwm.gaps.set_outer(12, 8) ``` ### Response #### Success Response (200) N/A (Configuration changes are applied directly) #### Response Example N/A ``` -------------------------------- ### Keychord API Source: https://context7.com/tonybanters/oxwm/llms.txt Define multi-key sequences (keychords) for triggering actions, similar to Emacs or Vim. ```APIDOC ## Keychord API Create multi-key sequences similar to Emacs or Vim keybindings. ### Description This API enables the creation of complex keybindings that involve a sequence of key presses, allowing for more advanced shortcuts. ### Method `oxwm.key.chord(key_sequence, action)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **key_sequence** (table) - Required - A table of tables, where each inner table represents a key press with its modifiers and key (e.g., `{{ { "Mod4" }, "Space" }, { {}, "T" }}`). - **action** (function) - Required - The function to execute when the key sequence is completed. ### Request Example ```lua oxwm.key.chord({ { { "Mod4" }, "Space" }, { {}, "T" } }, oxwm.spawn_terminal()) ``` ### Response No direct response, actions are executed upon completion of the keychord. #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Multi-Monitor API Source: https://context7.com/tonybanters/oxwm/llms.txt Control window focus and movement across multiple monitors. ```APIDOC ## Multi-Monitor API Focus and move windows between multiple monitors. ### Description This API allows users to manage windows and focus across different physical displays connected to the system. ### Method `oxwm.monitor.focus(direction)` `oxwm.monitor.tag(direction)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **direction** (number) - Required - `-1` for previous monitor, `1` for next monitor. ### Request Example ```lua oxwm.key.bind({ "Mod4" }, "Comma", oxwm.monitor.focus(-1)) oxwm.key.bind({ "Mod4", "Shift" }, "Period", oxwm.monitor.tag(1)) ``` ### Response No direct response, actions change the active monitor or window placement. #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Configure Status Bar Appearance Source: https://context7.com/tonybanters/oxwm/llms.txt Set the font, position, and color schemes for the OXWM status bar. Use 'fc-list' to find available fonts. ```lua -- Set bar font (use "fc-list" to see available fonts) oxwm.bar.set_font("monospace:style=Bold:size=10") oxwm.bar.set_font("JetBrains Mono:size=11") -- Set bar position ("top" or "bottom") oxwm.bar.set_position("top") -- Hide empty/vacant tags oxwm.bar.set_hide_vacant_tags(true) -- Color schemes for tag display -- Parameters: foreground, background, border/underline color -- Unselected, empty tags oxwm.bar.set_scheme_normal("#bbbbbb", "#1a1b26", "#444444") -- Tags with windows but not selected oxwm.bar.set_scheme_occupied("#0db9d7", "#1a1b26", "#0db9d7") -- Currently selected tag oxwm.bar.set_scheme_selected("#0db9d7", "#1a1b26", "#ad8ee6") -- Tags with urgent windows oxwm.bar.set_scheme_urgent("#f7768e", "#1a1b26", "#f7768e") ``` -------------------------------- ### Add Status Bar Information Blocks Source: https://context7.com/tonybanters/oxwm/llms.txt Define and apply modular information blocks to the status bar, such as RAM usage, shell commands, date/time, battery status, and CPU temperature. Blocks can be configured with custom formats, intervals, colors, and click actions. ```lua -- Define blocks and set them on the bar local blocks = { -- RAM usage block oxwm.bar.block.ram({ format = "RAM: {used}/{total} GB", interval = 5, -- Update every 5 seconds color = "#7aa2f7", underline = true, }), -- Static separator oxwm.bar.block.static({ text = " | ", interval = 999999999, -- Never update color = "#a9b1d6", underline = false, }), -- Shell command block oxwm.bar.block.shell({ format = "{}", command = "uname -r", interval = 999999999, color = "#f7768e", underline = true, }), -- Date/time block oxwm.bar.block.datetime({ format = "{}", date_format = "%a, %b %d - %-I:%M %P", -- strftime format interval = 1, color = "#0db9d7", underline = true, }), -- Battery block (for laptops) oxwm.bar.block.battery({ format = "Bat: {}%", charging = "⚡ {}%", discharging = "🔋 {}%", full = "✓ {}%", interval = 30, color = "#9ece6a", underline = true, -- Optional: click action click = "alacritty -e btop", -- Or with floating option: -- click = { command = "pavucontrol", floating = true }, }), -- CPU temperature block oxwm.bar.block.cpu_temp({ format = "CPU: {}°C", interval = 5, color = "#ff9e64", underline = true, }), } -- Apply blocks to bar oxwm.bar.set_blocks(blocks) ``` -------------------------------- ### Window Rules API Source: https://context7.com/tonybanters/oxwm/llms.txt Functions to automatically configure window properties based on class, instance, or title. ```APIDOC ## Window Rules API ### Description Automatically configure windows based on their class, instance, or title. ### Methods - **oxwm.rule.add(rule_table)**: Adds a rule. The table can contain match criteria (instance, class, title) and properties (floating, tag, focus). ``` -------------------------------- ### Border Configuration API Source: https://context7.com/tonybanters/oxwm/llms.txt Control window border appearance including width and colors for focused/unfocused states. ```APIDOC ## Border Configuration API ### Description Control window border appearance including width and colors for focused/unfocused states. ### Method N/A (Configuration script) ### Endpoint N/A (Configuration script) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua -- Set border width in pixels oxwm.border.set_width(2) -- Set focused window border color oxwm.border.set_focused_color("#6dade3") -- Set unfocused window border color oxwm.border.set_unfocused_color("#444444") -- Example: Complete border configuration local colors = { blue = "#6dade3", grey = "#bbbbbb", } oxwm.border.set_width(3) oxwm.border.set_focused_color(colors.blue) oxwm.border.set_unfocused_color(colors.grey) ``` ### Response #### Success Response (200) N/A (Configuration changes are applied directly) #### Response Example N/A ``` -------------------------------- ### Tag/Workspace Management API Source: https://context7.com/tonybanters/oxwm/llms.txt Manage workspaces (tags) by viewing, switching, and moving windows between them. Supports single and multiple tag views. ```APIDOC ## Tag/Workspace Management API Navigate between workspaces and move windows between tags. ### Description This API provides functions to interact with the tag (workspace) system, allowing users to organize and switch between different virtual desktops. ### Method `oxwm.tag.view(tag_index)` `oxwm.tag.move_to(tag_index)` `oxwm.tag.toggleview(tag_index)` `oxwm.tag.toggletag(tag_index)` `oxwm.tag.view_previous()` `oxwm.tag.view_next()` `oxwm.tag.view_previous_nonempty()` `oxwm.tag.view_next_nonempty()` `oxwm.tag.set_back_and_forth(boolean)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tag_index** (number) - Required - The 0-indexed number of the tag. - **boolean** (boolean) - Required for `set_back_and_forth` - Enables or disables tag back-and-forth functionality. ### Request Example ```lua oxwm.key.bind({ "Mod4" }, "1", oxwm.tag.view(0)) oxwm.key.bind({ "Mod4", "Shift" }, "1", oxwm.tag.move_to(0)) oxwm.tag.set_back_and_forth(true) ``` ### Response No direct response, actions modify the current workspace state. #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Status Bar Configuration API Source: https://context7.com/tonybanters/oxwm/llms.txt Functions to configure the appearance and behavior of the built-in status bar, including fonts, positioning, and color schemes. ```APIDOC ## Status Bar Configuration API ### Description Configure the built-in status bar including font, position, and color schemes. ### Methods - **oxwm.bar.set_font(font_string)**: Sets the bar font. - **oxwm.bar.set_position(position)**: Sets bar position ("top" or "bottom"). - **oxwm.bar.set_hide_vacant_tags(boolean)**: Hides empty/vacant tags. - **oxwm.bar.set_scheme_normal(fg, bg, border)**: Sets colors for unselected, empty tags. - **oxwm.bar.set_scheme_occupied(fg, bg, border)**: Sets colors for tags with windows but not selected. - **oxwm.bar.set_scheme_selected(fg, bg, border)**: Sets colors for the currently selected tag. - **oxwm.bar.set_scheme_urgent(fg, bg, border)**: Sets colors for tags with urgent windows. ``` -------------------------------- ### Status Bar Blocks API Source: https://context7.com/tonybanters/oxwm/llms.txt Functions to add modular information blocks to the status bar. ```APIDOC ## Status Bar Blocks API ### Description Add modular information blocks to the status bar (similar to dwmblocks or qtile widgets). ### Methods - **oxwm.bar.block.ram(options)**: RAM usage block. - **oxwm.bar.block.static(options)**: Static text block. - **oxwm.bar.block.shell(options)**: Shell command output block. - **oxwm.bar.block.datetime(options)**: Date and time block. - **oxwm.bar.block.battery(options)**: Battery status block. - **oxwm.bar.block.cpu_temp(options)**: CPU temperature block. - **oxwm.bar.set_blocks(blocks_table)**: Applies the defined blocks to the bar. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.