| 1 |
---@meta
|
| 2 |
|
| 3 |
---OXWM Configuration API Type Definitions
|
| 4 |
---
|
| 5 |
---DO NOT EDIT THIS FILE
|
| 6 |
---This file is automatically generated and managed by OXWM.
|
| 7 |
---It will be overwritten on every OXWM update to match the running version.
|
| 8 |
---
|
| 9 |
---Location: ~/.config/oxwm/lib/oxwm.lua
|
| 10 |
---Configured via: ~/.config/oxwm/.luarc.json
|
| 11 |
---
|
| 12 |
---This file provides LSP autocomplete and type checking for your config.lua.
|
| 13 |
---To use it, add this to the top of your config.lua:
|
| 14 |
--- ---@module 'oxwm'
|
| 15 |
---
|
| 16 |
---@class oxwm
|
| 17 |
oxwm = {}
|
| 18 |
|
| 19 |
---Spawn a command
|
| 20 |
---@param cmd string|string[] Command to spawn (string or array of strings)
|
| 21 |
---@return table Action table for keybinding
|
| 22 |
function oxwm.spawn(cmd) end
|
| 23 |
|
| 24 |
---Spawn the configured terminal emulator
|
| 25 |
---@return table Action table for keybinding
|
| 26 |
function oxwm.spawn_terminal() end
|
| 27 |
|
| 28 |
---Set the terminal emulator
|
| 29 |
---@param terminal string Terminal command (e.g., "st", "alacritty")
|
| 30 |
function oxwm.set_terminal(terminal) end
|
| 31 |
|
| 32 |
---Set the modifier key
|
| 33 |
---@param modkey string Modifier key ("Mod1", "Mod4", "Shift", "Control")
|
| 34 |
function oxwm.set_modkey(modkey) end
|
| 35 |
|
| 36 |
---Set workspace tags
|
| 37 |
---@param tags string[] Array of tag names
|
| 38 |
function oxwm.set_tags(tags) end
|
| 39 |
|
| 40 |
---Enable or disable automatic tiling of new windows
|
| 41 |
---@param enabled boolean Enable or disable auto-tiling
|
| 42 |
function oxwm.auto_tile(enabled) end
|
| 43 |
|
| 44 |
---Set layout symbol override
|
| 45 |
---@param name string Layout name (e.g., "tiling", "normie", "tabbed", "grid", "monocle")
|
| 46 |
---@param symbol string Symbol to display (e.g., "[T]", "[F]", "[=]")
|
| 47 |
function oxwm.set_layout_symbol(name, symbol) end
|
| 48 |
|
| 49 |
---Window rule module
|
| 50 |
---@class oxwm.rule
|
| 51 |
oxwm.rule = {}
|
| 52 |
|
| 53 |
---Add a window rule
|
| 54 |
---@param rule {class: string?, instance: string?, title: string?, role: string?, floating: boolean?, tag: integer?, fullscreen: boolean?} Rule configuration
|
| 55 |
function oxwm.rule.add(rule) end
|
| 56 |
|
| 57 |
---Quit the window manager
|
| 58 |
---@return table Action table for keybinding
|
| 59 |
function oxwm.quit() end
|
| 60 |
|
| 61 |
---Restart the window manager
|
| 62 |
---@return table Action table for keybinding
|
| 63 |
function oxwm.restart() end
|
| 64 |
|
| 65 |
---Recompile the window manager
|
| 66 |
---@return table Action table for keybinding
|
| 67 |
function oxwm.recompile() end
|
| 68 |
|
| 69 |
---Toggle gaps on/off
|
| 70 |
---@return table Action table for keybinding
|
| 71 |
function oxwm.toggle_gaps() end
|
| 72 |
|
| 73 |
---Show keybind overlay
|
| 74 |
---@return table Action table for keybinding
|
| 75 |
function oxwm.show_keybinds() end
|
| 76 |
|
| 77 |
---Set master area factor (adjust master window width in tiling layout)
|
| 78 |
---@param delta integer Delta to adjust by (negative to decrease, positive to increase)
|
| 79 |
---@return table Action table for keybinding
|
| 80 |
function oxwm.set_master_factor(delta) end
|
| 81 |
|
| 82 |
---Increment/decrement number of master windows
|
| 83 |
---@param delta integer Delta to adjust by (negative to decrease, positive to increase)
|
| 84 |
---@return table Action table for keybinding
|
| 85 |
function oxwm.inc_num_master(delta) end
|
| 86 |
|
| 87 |
---Keybinding module
|
| 88 |
---@class oxwm.key
|
| 89 |
oxwm.key = {}
|
| 90 |
|
| 91 |
---Bind a key combination to an action
|
| 92 |
---@param modifiers string|string[] Modifier keys (e.g., {"Mod4"}, {"Mod4", "Shift"})
|
| 93 |
---@param key string Key name (e.g., "Return", "Q", "1")
|
| 94 |
---@param action table Action returned by oxwm functions
|
| 95 |
function oxwm.key.bind(modifiers, key, action) end
|
| 96 |
|
| 97 |
---Bind a keychord (multi-key sequence) to an action
|
| 98 |
---@param keys table[] Array of key presses, each: {{modifiers}, key}
|
| 99 |
---@param action table Action returned by oxwm functions
|
| 100 |
function oxwm.key.chord(keys, action) end
|
| 101 |
|
| 102 |
---Gap configuration module
|
| 103 |
---@class oxwm.gaps
|
| 104 |
oxwm.gaps = {}
|
| 105 |
|
| 106 |
---Set gaps enabled/disabled
|
| 107 |
---@param enabled boolean Enable or disable gaps
|
| 108 |
function oxwm.gaps.set_enabled(enabled) end
|
| 109 |
|
| 110 |
---Enable gaps
|
| 111 |
function oxwm.gaps.enable() end
|
| 112 |
|
| 113 |
---Disable gaps
|
| 114 |
function oxwm.gaps.disable() end
|
| 115 |
|
| 116 |
---Set inner gaps
|
| 117 |
---@param horizontal integer Horizontal inner gap in pixels
|
| 118 |
---@param vertical integer Vertical inner gap in pixels
|
| 119 |
function oxwm.gaps.set_inner(horizontal, vertical) end
|
| 120 |
|
| 121 |
---Set outer gaps
|
| 122 |
---@param horizontal integer Horizontal outer gap in pixels
|
| 123 |
---@param vertical integer Vertical outer gap in pixels
|
| 124 |
function oxwm.gaps.set_outer(horizontal, vertical) end
|
| 125 |
|
| 126 |
---Set smart gaps (disable outer gaps when only one window visible)
|
| 127 |
---@param enabled boolean Enable or disable smart gaps
|
| 128 |
function oxwm.gaps.set_smart(enabled) end
|
| 129 |
|
| 130 |
---Border configuration module
|
| 131 |
---@class oxwm.border
|
| 132 |
oxwm.border = {}
|
| 133 |
|
| 134 |
---Set border width
|
| 135 |
---@param width integer Border width in pixels
|
| 136 |
function oxwm.border.set_width(width) end
|
| 137 |
|
| 138 |
---Set focused window border color
|
| 139 |
---@param color string|integer Color as hex string ("#ff0000", "0xff0000") or integer
|
| 140 |
function oxwm.border.set_focused_color(color) end
|
| 141 |
|
| 142 |
---Set unfocused window border color
|
| 143 |
---@param color string|integer Color as hex string ("#666666", "0x666666") or integer
|
| 144 |
function oxwm.border.set_unfocused_color(color) end
|
| 145 |
|
| 146 |
---Client/window management module
|
| 147 |
---@class oxwm.client
|
| 148 |
oxwm.client = {}
|
| 149 |
|
| 150 |
---Kill the focused window
|
| 151 |
---@return table Action table for keybinding
|
| 152 |
function oxwm.client.kill() end
|
| 153 |
|
| 154 |
---Toggle fullscreen mode
|
| 155 |
---@return table Action table for keybinding
|
| 156 |
function oxwm.client.toggle_fullscreen() end
|
| 157 |
|
| 158 |
---Toggle floating mode
|
| 159 |
---@return table Action table for keybinding
|
| 160 |
function oxwm.client.toggle_floating() end
|
| 161 |
|
| 162 |
---Focus stack (next/previous window)
|
| 163 |
---@param dir integer Direction (1 for next, -1 for previous)
|
| 164 |
---@return table Action table for keybinding
|
| 165 |
function oxwm.client.focus_stack(dir) end
|
| 166 |
|
| 167 |
---Move stack (next/previous window)
|
| 168 |
---@param dir integer Direction (1 for next, -1 for previous)
|
| 169 |
---@return table Action table for keybinding
|
| 170 |
function oxwm.client.move_stack(dir) end
|
| 171 |
|
| 172 |
---Monitor management module
|
| 173 |
---@class oxwm.monitor
|
| 174 |
oxwm.monitor = {}
|
| 175 |
|
| 176 |
---Focus monitor
|
| 177 |
---@param dir integer Direction (-1 for previous, 1 for next)
|
| 178 |
---@return table Action table for keybinding
|
| 179 |
function oxwm.monitor.focus(dir) end
|
| 180 |
|
| 181 |
---Send focused window to monitor
|
| 182 |
---@param dir integer Direction (-1 for previous, 1 for next)
|
| 183 |
---@return table Action table for keybinding
|
| 184 |
function oxwm.monitor.tag(dir) end
|
| 185 |
|
| 186 |
---Layout management module
|
| 187 |
---@class oxwm.layout
|
| 188 |
oxwm.layout = {}
|
| 189 |
|
| 190 |
---Cycle through layouts
|
| 191 |
---@return table Action table for keybinding
|
| 192 |
function oxwm.layout.cycle() end
|
| 193 |
|
| 194 |
---Set specific layout
|
| 195 |
---@param name string Layout name (e.g., "tiling", "normie", "tabbed", "grid", "monocle")
|
| 196 |
---@return table Action table for keybinding
|
| 197 |
function oxwm.layout.set(name) end
|
| 198 |
|
| 199 |
---Tag/workspace management module
|
| 200 |
---@class oxwm.tag
|
| 201 |
oxwm.tag = {}
|
| 202 |
|
| 203 |
---View/switch to tag
|
| 204 |
---@param index integer Tag index (0-based)
|
| 205 |
---@return table Action table for keybinding
|
| 206 |
function oxwm.tag.view(index) end
|
| 207 |
|
| 208 |
---Move focused window to tag
|
| 209 |
---@param index integer Tag index (0-based)
|
| 210 |
---@return table Action table for keybinding
|
| 211 |
function oxwm.tag.move_to(index) end
|
| 212 |
|
| 213 |
---Toggle viewing a tag (allows viewing multiple tags at once)
|
| 214 |
---@param index integer Tag index (0-based)
|
| 215 |
---@return table Action table for keybinding
|
| 216 |
function oxwm.tag.toggleview(index) end
|
| 217 |
|
| 218 |
---Toggle tag on focused window (allows window to appear on multiple tags)
|
| 219 |
---@param index integer Tag index (0-based)
|
| 220 |
---@return table Action table for keybinding
|
| 221 |
function oxwm.tag.toggletag(index) end
|
| 222 |
|
| 223 |
---Status bar configuration module
|
| 224 |
---@class oxwm.bar
|
| 225 |
oxwm.bar = {}
|
| 226 |
|
| 227 |
---Set status bar font
|
| 228 |
---@param font string Font string (e.g., "monospace:style=Bold:size=10")
|
| 229 |
function oxwm.bar.set_font(font) end
|
| 230 |
|
| 231 |
---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead)
|
| 232 |
---@deprecated
|
| 233 |
---@param format string Format string with {} placeholders
|
| 234 |
---@param command "DateTime"|"Shell"|"Ram"|"Static" Block command type (Battery not supported)
|
| 235 |
---@param arg string|nil Command argument (format for DateTime, command for Shell, text for Static, nil for Ram)
|
| 236 |
---@param interval integer Update interval in seconds
|
| 237 |
---@param color string|integer Color as hex string or integer
|
| 238 |
---@param underline boolean Whether to underline the block
|
| 239 |
function oxwm.bar.add_block(format, command, arg, interval, color, underline) end
|
| 240 |
|
| 241 |
---Set status bar blocks using block constructors
|
| 242 |
---@param blocks table[] Array of block configurations created with oxwm.bar.block.*
|
| 243 |
function oxwm.bar.set_blocks(blocks) end
|
| 244 |
|
| 245 |
---Block constructors module
|
| 246 |
---@class oxwm.bar.block
|
| 247 |
oxwm.bar.block = {}
|
| 248 |
|
| 249 |
---Create a RAM usage block
|
| 250 |
---@param config {format: string, interval: integer, color: string|integer, underline: boolean} Block configuration
|
| 251 |
---@return table Block configuration
|
| 252 |
function oxwm.bar.block.ram(config) end
|
| 253 |
|
| 254 |
---Create a date/time block
|
| 255 |
---@param config {format: string, date_format: string, interval: integer, color: string|integer, underline: boolean} Block configuration (format is display template with {}, date_format is strftime format)
|
| 256 |
---@return table Block configuration
|
| 257 |
function oxwm.bar.block.datetime(config) end
|
| 258 |
|
| 259 |
---Create a shell command block
|
| 260 |
---@param config {format: string, command: string, interval: integer, color: string|integer, underline: boolean} Block configuration
|
| 261 |
---@return table Block configuration
|
| 262 |
function oxwm.bar.block.shell(config) end
|
| 263 |
|
| 264 |
---Create a static text block
|
| 265 |
---@param config {format: string, text: string, interval: integer, color: string|integer, underline: boolean} Block configuration
|
| 266 |
---@return table Block configuration
|
| 267 |
function oxwm.bar.block.static(config) end
|
| 268 |
|
| 269 |
---Create a battery status block
|
| 270 |
---@param config {format: string, charging: string, discharging: string, full: string, interval: integer, color: string|integer, underline: boolean} Block configuration
|
| 271 |
---@return table Block configuration
|
| 272 |
function oxwm.bar.block.battery(config) end
|
| 273 |
|
| 274 |
---Set normal tag color scheme (unselected, no windows)
|
| 275 |
---@param foreground string|integer Foreground color
|
| 276 |
---@param background string|integer Background color
|
| 277 |
---@param underline string|integer Underline color
|
| 278 |
function oxwm.bar.set_scheme_normal(foreground, background, underline) end
|
| 279 |
|
| 280 |
---Set occupied tag color scheme (unselected, has windows)
|
| 281 |
---@param foreground string|integer Foreground color
|
| 282 |
---@param background string|integer Background color
|
| 283 |
---@param underline string|integer Underline color
|
| 284 |
function oxwm.bar.set_scheme_occupied(foreground, background, underline) end
|
| 285 |
|
| 286 |
---Set selected tag color scheme (currently selected tag)
|
| 287 |
---@param foreground string|integer Foreground color
|
| 288 |
---@param background string|integer Background color
|
| 289 |
---@param underline string|integer Underline color
|
| 290 |
function oxwm.bar.set_scheme_selected(foreground, background, underline) end
|
| 291 |
|
| 292 |
---Add an autostart command
|
| 293 |
---@param cmd string Command to run at startup
|
| 294 |
function oxwm.autostart(cmd) end
|