| 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 | ---Enable or disable tiled resize mode (Mod+RMB adjusts mfact instead of floating) |
| 45 | ---@param enabled boolean Enable or disable tiled resize mode |
| 46 | function oxwm.tiled_resize_mode(enabled) end |
| 47 | |
| 48 | ---Set layout symbol override |
| 49 | ---@param name string Layout name (e.g., "tiling", "normie", "tabbed", "grid", "monocle", "dwindle") |
| 50 | ---@param symbol string Symbol to display (e.g., "[T]", "[F]", "[=]", "[\\]") |
| 51 | function oxwm.set_layout_symbol(name, symbol) end |
| 52 | |
| 53 | ---Set default layout for all tags |
| 54 | ---@param name string Layout name ("tiling", "floating", "scrolling", "grid", "monocle", "dwindle", or aliases: "tile", "float", "scroll", "normie", "fib", "fibonacci") |
| 55 | function oxwm.set_layout(name) end |
| 56 | |
| 57 | ---Set default layout for a specific tag |
| 58 | ---@param tag integer Tag index (1-9) |
| 59 | ---@param name string Layout name ("tiling", "floating", "scrolling", "grid", "monocle", "dwindle", or aliases) |
| 60 | function oxwm.set_tag_layout(tag, name) end |
| 61 | |
| 62 | ---Set default attach method |
| 63 | ---@param name string Attach Method name ("aside", "top", "bottom", "above", "below") |
| 64 | function oxwm.set_attach_method(name) end |
| 65 | |
| 66 | ---Set floating window spawn position |
| 67 | ---@param position string Position ("center", "top-left", "top-right", "bottom-left", "bottom-right", "top-center", "bottom-center", "center-left", "center-right", or underscore variants) |
| 68 | function oxwm.set_floating_position(position) end |
| 69 | |
| 70 | ---Toggle the status bar visibility |
| 71 | ---@return table Action table for keybinding |
| 72 | function oxwm.toggle_bar() end |
| 73 | |
| 74 | ---Window rule module |
| 75 | ---@class oxwm.rule |
| 76 | oxwm.rule = {} |
| 77 | |
| 78 | ---Add a window rule |
| 79 | ---@param rule {class: string?, instance: string?, title: string?, role: string?, floating: boolean?, tag: integer?, fullscreen: boolean?, focus: boolean?, width: number?} Rule configuration (`width` is the scrolling layout column width: a proportion at or below 1, otherwise pixels) |
| 80 | function oxwm.rule.add(rule) end |
| 81 | |
| 82 | ---Quit the window manager |
| 83 | ---@return table Action table for keybinding |
| 84 | function oxwm.quit() end |
| 85 | |
| 86 | ---Restart the window manager |
| 87 | ---@return table Action table for keybinding |
| 88 | function oxwm.restart() end |
| 89 | |
| 90 | ---Recompile the window manager |
| 91 | ---@return table Action table for keybinding |
| 92 | function oxwm.recompile() end |
| 93 | |
| 94 | ---Toggle gaps on/off |
| 95 | ---@return table Action table for keybinding |
| 96 | function oxwm.toggle_gaps() end |
| 97 | |
| 98 | ---Show keybind overlay |
| 99 | ---@return table Action table for keybinding |
| 100 | function oxwm.show_keybinds() end |
| 101 | |
| 102 | ---Set master area factor (adjust master window width in tiling layout) |
| 103 | ---@param delta integer Delta to adjust by (negative to decrease, positive to increase) |
| 104 | ---@return table Action table for keybinding |
| 105 | function oxwm.set_master_factor(delta) end |
| 106 | |
| 107 | ---Increment/decrement number of master windows |
| 108 | ---@param delta integer Delta to adjust by (negative to decrease, positive to increase) |
| 109 | ---@return table Action table for keybinding |
| 110 | function oxwm.inc_num_master(delta) end |
| 111 | |
| 112 | ---Keybinding module |
| 113 | ---@class oxwm.key |
| 114 | oxwm.key = {} |
| 115 | |
| 116 | ---Bind a key combination to an action |
| 117 | ---@param modifiers string|string[] Modifier keys (e.g., {"Mod4"}, {"Mod4", "Shift"}) |
| 118 | ---@param key string Key name (e.g., "Return", "Q", "1") |
| 119 | ---@param action table Action returned by oxwm functions |
| 120 | function oxwm.key.bind(modifiers, key, action) end |
| 121 | |
| 122 | ---Bind a keychord (multi-key sequence) to an action |
| 123 | ---@param keys table[] Array of key presses, each: {{modifiers}, key} |
| 124 | ---@param action table Action returned by oxwm functions |
| 125 | function oxwm.key.chord(keys, action) end |
| 126 | |
| 127 | ---Gap configuration module |
| 128 | ---@class oxwm.gaps |
| 129 | oxwm.gaps = {} |
| 130 | |
| 131 | ---Set gaps enabled/disabled |
| 132 | ---@param enabled boolean Enable or disable gaps |
| 133 | function oxwm.gaps.set_enabled(enabled) end |
| 134 | |
| 135 | ---Enable gaps |
| 136 | function oxwm.gaps.enable() end |
| 137 | |
| 138 | ---Disable gaps |
| 139 | function oxwm.gaps.disable() end |
| 140 | |
| 141 | ---Set inner gaps |
| 142 | ---@param horizontal integer Horizontal inner gap in pixels |
| 143 | ---@param vertical integer Vertical inner gap in pixels |
| 144 | function oxwm.gaps.set_inner(horizontal, vertical) end |
| 145 | |
| 146 | ---Set outer gaps |
| 147 | ---@param horizontal integer Horizontal outer gap in pixels |
| 148 | ---@param vertical integer Vertical outer gap in pixels |
| 149 | function oxwm.gaps.set_outer(horizontal, vertical) end |
| 150 | |
| 151 | ---Set smart gaps (disable outer gaps when only one window visible) |
| 152 | ---@param enabled boolean Enable or disable smart gaps |
| 153 | function oxwm.gaps.set_smart(enabled) end |
| 154 | |
| 155 | ---Border configuration module |
| 156 | ---@class oxwm.border |
| 157 | oxwm.border = {} |
| 158 | |
| 159 | ---Set border width |
| 160 | ---@param width integer Border width in pixels |
| 161 | function oxwm.border.set_width(width) end |
| 162 | |
| 163 | ---Set focused window border color |
| 164 | ---@param color string|integer Color as hex string ("#ff0000", "0xff0000") or integer |
| 165 | function oxwm.border.set_focused_color(color) end |
| 166 | |
| 167 | ---Set unfocused window border color |
| 168 | ---@param color string|integer Color as hex string ("#666666", "0x666666") or integer |
| 169 | function oxwm.border.set_unfocused_color(color) end |
| 170 | |
| 171 | ---Client/window management module |
| 172 | ---@class oxwm.client |
| 173 | oxwm.client = {} |
| 174 | |
| 175 | ---Kill the focused window |
| 176 | ---@return table Action table for keybinding |
| 177 | function oxwm.client.kill() end |
| 178 | |
| 179 | ---Toggle fullscreen mode |
| 180 | ---@return table Action table for keybinding |
| 181 | function oxwm.client.toggle_fullscreen() end |
| 182 | |
| 183 | ---Toggle floating mode |
| 184 | ---@return table Action table for keybinding |
| 185 | function oxwm.client.toggle_floating() end |
| 186 | |
| 187 | ---Focus stack (next/previous window) |
| 188 | ---@param dir integer Direction (1 for next, -1 for previous) |
| 189 | ---@return table Action table for keybinding |
| 190 | function oxwm.client.focus_stack(dir) end |
| 191 | |
| 192 | ---Move stack (next/previous window) |
| 193 | ---@param dir integer Direction (1 for next, -1 for previous) |
| 194 | ---@return table Action table for keybinding |
| 195 | function oxwm.client.move_stack(dir) end |
| 196 | |
| 197 | ---Monitor management module |
| 198 | ---@class oxwm.monitor |
| 199 | oxwm.monitor = {} |
| 200 | |
| 201 | ---Focus monitor |
| 202 | ---@param dir integer Direction (-1 for previous, 1 for next) |
| 203 | ---@return table Action table for keybinding |
| 204 | function oxwm.monitor.focus(dir) end |
| 205 | |
| 206 | ---Send focused window to monitor |
| 207 | ---@param dir integer Direction (-1 for previous, 1 for next) |
| 208 | ---@return table Action table for keybinding |
| 209 | function oxwm.monitor.tag(dir) end |
| 210 | |
| 211 | ---Warp the cursor to the focused monitor when switching monitors |
| 212 | ---@param enabled boolean |
| 213 | function oxwm.monitor.warp_cursor(enabled) end |
| 214 | |
| 215 | ---Warp the cursor along when sending a window to another monitor |
| 216 | ---@param enabled boolean |
| 217 | function oxwm.monitor.warp_cursor_on_send(enabled) end |
| 218 | |
| 219 | ---Layout management module |
| 220 | ---@class oxwm.layout |
| 221 | oxwm.layout = {} |
| 222 | |
| 223 | ---Cycle through layouts |
| 224 | ---@return table Action table for keybinding |
| 225 | function oxwm.layout.cycle() end |
| 226 | |
| 227 | ---Set specific layout |
| 228 | ---@param name string Layout name (e.g., "tiling", "normie", "tabbed", "grid", "monocle", "scrolling", "dwindle") |
| 229 | ---@return table Action table for keybinding |
| 230 | function oxwm.layout.set(name) end |
| 231 | |
| 232 | ---Scroll layout left (for scrolling layout) |
| 233 | ---@return table Action table for keybinding |
| 234 | function oxwm.layout.scroll_left() end |
| 235 | |
| 236 | ---Scroll layout right (for scrolling layout) |
| 237 | ---@return table Action table for keybinding |
| 238 | function oxwm.layout.scroll_right() end |
| 239 | |
| 240 | ---Cycle the focused window through the scrolling width presets |
| 241 | ---@param direction integer? 1 for the next preset, -1 for the previous (default 1) |
| 242 | ---@return table Action table for keybinding |
| 243 | function oxwm.layout.cycle_width(direction) end |
| 244 | |
| 245 | ---Set the focused window's width in the scrolling layout |
| 246 | ---@param width number Proportion of the screen (0-1) or pixels (> 1) |
| 247 | ---@return table Action table for keybinding |
| 248 | function oxwm.layout.set_width(width) end |
| 249 | |
| 250 | ---Scrolling layout module |
| 251 | ---@class oxwm.scroll |
| 252 | oxwm.scroll = {} |
| 253 | |
| 254 | ---Set the default column width for new windows in the scrolling layout |
| 255 | ---@param width number Proportion of the screen (0-1) or pixels (> 1), default 0.5 |
| 256 | function oxwm.scroll.set_default_width(width) end |
| 257 | |
| 258 | ---Set the width presets cycled by oxwm.layout.cycle_width |
| 259 | ---@param presets number[] Up to 8 widths, default { 1/3, 1/2, 2/3 } |
| 260 | function oxwm.scroll.set_width_presets(presets) end |
| 261 | |
| 262 | ---Enable or disable touchpad swipe gestures (requires read access to /dev/input) |
| 263 | ---@param enabled boolean Default true |
| 264 | function oxwm.scroll.set_gesture_enabled(enabled) end |
| 265 | |
| 266 | ---Set how many fingers a swipe needs to scroll the layout |
| 267 | ---@param fingers integer 3, 4 or 5 (default 3) |
| 268 | function oxwm.scroll.set_gesture_fingers(fingers) end |
| 269 | |
| 270 | ---Set how far the view moves per unit of finger travel |
| 271 | ---@param speed number Multiplier, default 2.0 |
| 272 | function oxwm.scroll.set_gesture_speed(speed) end |
| 273 | |
| 274 | ---Invert the swipe direction so the windows follow the fingers |
| 275 | ---@param natural boolean Default false |
| 276 | function oxwm.scroll.set_gesture_natural(natural) end |
| 277 | |
| 278 | ---Tag/workspace management module |
| 279 | ---@class oxwm.tag |
| 280 | oxwm.tag = {} |
| 281 | |
| 282 | ---View/switch to tag |
| 283 | ---@param index integer Tag index (0-based) |
| 284 | ---@return table Action table for keybinding |
| 285 | function oxwm.tag.view(index) end |
| 286 | |
| 287 | ---View/switch to next tag |
| 288 | ---@return table Action table for keybinding |
| 289 | function oxwm.tag.view_next() end |
| 290 | |
| 291 | ---View/switch to previous tag |
| 292 | ---@return table Action table for keybinding |
| 293 | function oxwm.tag.view_previous() end |
| 294 | |
| 295 | ---View/switch to next non-empty tag |
| 296 | ---@return table Action table for keybinding |
| 297 | function oxwm.tag.view_next_nonempty() end |
| 298 | |
| 299 | ---View/switch to previous non-empty tag |
| 300 | ---@return table Action table for keybinding |
| 301 | function oxwm.tag.view_previous_nonempty() end |
| 302 | |
| 303 | ---Move focused window to tag |
| 304 | ---@param index integer Tag index (0-based) |
| 305 | ---@return table Action table for keybinding |
| 306 | function oxwm.tag.move_to(index) end |
| 307 | |
| 308 | ---Toggle viewing a tag (allows viewing multiple tags at once) |
| 309 | ---@param index integer Tag index (0-based) |
| 310 | ---@return table Action table for keybinding |
| 311 | function oxwm.tag.toggleview(index) end |
| 312 | |
| 313 | ---Toggle tag on focused window (allows window to appear on multiple tags) |
| 314 | ---@param index integer Tag index (0-based) |
| 315 | ---@return table Action table for keybinding |
| 316 | function oxwm.tag.toggletag(index) end |
| 317 | |
| 318 | ---When enabled an attempt to view the current tag switches back to the previously viewed tag. |
| 319 | ---@param enabled boolean Enable or disable tag_back_and_forth |
| 320 | function oxwm.tag.set_back_and_forth(enabled) end |
| 321 | |
| 322 | ---Status bar configuration module |
| 323 | ---@class oxwm.bar |
| 324 | oxwm.bar = {} |
| 325 | |
| 326 | ---Set status bar font |
| 327 | ---@param font string Font string (e.g., "monospace:style=Bold:size=10") |
| 328 | function oxwm.bar.set_font(font) end |
| 329 | |
| 330 | ---Set status bar position |
| 331 | ---@param position string Bar position ("top" or "bottom") |
| 332 | function oxwm.bar.set_position(position) end |
| 333 | |
| 334 | ---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead) |
| 335 | ---@deprecated |
| 336 | ---@param format string Format string with {} placeholders |
| 337 | ---@param command "DateTime"|"Shell"|"Ram"|"Static" Block command type (Battery not supported) |
| 338 | ---@param arg string|nil Command argument (format for DateTime, command for Shell, text for Static, nil for Ram) |
| 339 | ---@param interval integer Update interval in seconds |
| 340 | ---@param color string|integer Color as hex string or integer |
| 341 | ---@param underline boolean Whether to underline the block |
| 342 | function oxwm.bar.add_block(format, command, arg, interval, color, underline) end |
| 343 | |
| 344 | ---Set status bar blocks using block constructors |
| 345 | ---@param blocks table[] Array of block configurations created with oxwm.bar.block.* |
| 346 | function oxwm.bar.set_blocks(blocks) end |
| 347 | |
| 348 | ---Block constructors module |
| 349 | ---@class oxwm.bar.block |
| 350 | oxwm.bar.block = {} |
| 351 | |
| 352 | ---Create a RAM usage block |
| 353 | ---@param config {format: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 354 | ---@return table Block configuration |
| 355 | function oxwm.bar.block.ram(config) end |
| 356 | |
| 357 | ---Create a date/time block |
| 358 | ---@param config {format: string, date_format: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration (format is display template with {}, date_format is strftime format) |
| 359 | ---@return table Block configuration |
| 360 | function oxwm.bar.block.datetime(config) end |
| 361 | |
| 362 | ---Create a shell command block |
| 363 | ---@param config {format: string, command: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 364 | ---@return table Block configuration |
| 365 | function oxwm.bar.block.shell(config) end |
| 366 | |
| 367 | ---Create a static text block |
| 368 | ---@param config {format: string, text: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 369 | ---@return table Block configuration |
| 370 | function oxwm.bar.block.static(config) end |
| 371 | |
| 372 | ---Create a battery status block |
| 373 | ---@param config {format: string, charging: string, discharging: string, full: string, interval: integer, color: string|integer, underline: boolean, battery_name: string, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 374 | ---@return table Block configuration |
| 375 | function oxwm.bar.block.battery(config) end |
| 376 | |
| 377 | ---Create a system tray block. Including this block enables the tray on the first bar; omitting it disables the tray entirely. |
| 378 | ---@param config {color: string|integer, underline: boolean}? Optional appearance config (only color and underline are used) |
| 379 | ---@return table Block configuration |
| 380 | function oxwm.bar.block.systray(config) end |
| 381 | |
| 382 | ---Set normal tag color scheme (unselected, no windows) |
| 383 | ---@param foreground string|integer Foreground color |
| 384 | ---@param background string|integer Background color |
| 385 | ---@param underline string|integer Underline color |
| 386 | function oxwm.bar.set_scheme_normal(foreground, background, underline) end |
| 387 | |
| 388 | ---Set occupied tag color scheme (unselected, has windows) |
| 389 | ---@param foreground string|integer Foreground color |
| 390 | ---@param background string|integer Background color |
| 391 | ---@param underline string|integer Underline color |
| 392 | function oxwm.bar.set_scheme_occupied(foreground, background, underline) end |
| 393 | |
| 394 | ---Set selected tag color scheme (currently selected tag) |
| 395 | ---@param foreground string|integer Foreground color |
| 396 | ---@param background string|integer Background color |
| 397 | ---@param underline string|integer Underline color |
| 398 | function oxwm.bar.set_scheme_selected(foreground, background, underline) end |
| 399 | |
| 400 | ---Set urgent tag color scheme (tags with urgent windows) |
| 401 | ---@param foreground string|integer Foreground color |
| 402 | ---@param background string|integer Background color |
| 403 | ---@param underline string|integer Underline color |
| 404 | function oxwm.bar.set_scheme_urgent(foreground, background, underline) end |
| 405 | |
| 406 | ---Hide tags that have no windows and are not currently selected |
| 407 | ---@param hide boolean Whether to hide vacant tags |
| 408 | function oxwm.bar.set_hide_vacant_tags(hide) end |
| 409 | |
| 410 | ---Add an autostart command |
| 411 | ---@param cmd string Command to run at startup |
| 412 | function oxwm.autostart(cmd) end |