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