Added docs for oxwm.lua lsp hints.
Browse files
+26 −5 templates/oxwm.lua
| @@ -46,6 +46,23 @@ function oxwm.auto_tile(enabled) end | |||
| 46 | ---@param symbol string Symbol to display (e.g., "[T]", "[F]", "[=]") | 46 | ---@param symbol string Symbol to display (e.g., "[T]", "[F]", "[=]") |
| 47 | function oxwm.set_layout_symbol(name, symbol) end | 47 | function oxwm.set_layout_symbol(name, symbol) end |
| 48 | 48 | ||
| 49 | +---Set default layout for all tags | ||
| 50 | +---@param name string Layout name ("tiling", "floating", "scrolling", "grid", "monocle", or aliases: "tile", "float", "scroll", "normie") | ||
| 51 | +function oxwm.set_layout(name) end | ||
| 52 | + | ||
| 53 | +---Set default layout for a specific tag | ||
| 54 | +---@param tag integer Tag index (1-9) | ||
| 55 | +---@param name string Layout name ("tiling", "floating", "scrolling", "grid", "monocle", or aliases) | ||
| 56 | +function oxwm.set_tag_layout(tag, name) end | ||
| 57 | + | ||
| 58 | +---Set floating window spawn position | ||
| 59 | +---@param position string Position ("center", "top-left", "top-right", "bottom-left", "bottom-right", "top-center", "bottom-center", "center-left", "center-right", or underscore variants) | ||
| 60 | +function oxwm.set_floating_position(position) end | ||
| 61 | + | ||
| 62 | +---Toggle the status bar visibility | ||
| 63 | +---@return table Action table for keybinding | ||
| 64 | +function oxwm.toggle_bar() end | ||
| 65 | + | ||
| 49 | ---Window rule module | 66 | ---Window rule module |
| 50 | ---@class oxwm.rule | 67 | ---@class oxwm.rule |
| 51 | oxwm.rule = {} | 68 | oxwm.rule = {} |
| @@ -256,6 +273,10 @@ oxwm.bar = {} | |||
| 256 | ---@param font string Font string (e.g., "monospace:style=Bold:size=10") | 273 | ---@param font string Font string (e.g., "monospace:style=Bold:size=10") |
| 257 | function oxwm.bar.set_font(font) end | 274 | function oxwm.bar.set_font(font) end |
| 258 | 275 | ||
| 276 | +---Set status bar position | ||
| 277 | +---@param position string Bar position ("top" or "bottom") | ||
| 278 | +function oxwm.bar.set_position(position) end | ||
| 279 | + | ||
| 259 | ---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead) | 280 | ---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead) |
| 260 | ---@deprecated | 281 | ---@deprecated |
| 261 | ---@param format string Format string with {} placeholders | 282 | ---@param format string Format string with {} placeholders |
| @@ -275,27 +296,27 @@ function oxwm.bar.set_blocks(blocks) end | |||
| 275 | oxwm.bar.block = {} | 296 | oxwm.bar.block = {} |
| 276 | 297 | ||
| 277 | ---Create a RAM usage block | 298 | ---Create a RAM usage block |
| 278 | ----@param config {format: string, interval: integer, color: string|integer, underline: boolean} Block configuration | 299 | +---@param config {format: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 279 | ---@return table Block configuration | 300 | ---@return table Block configuration |
| 280 | function oxwm.bar.block.ram(config) end | 301 | function oxwm.bar.block.ram(config) end |
| 281 | 302 | ||
| 282 | ---Create a date/time block | 303 | ---Create a date/time block |
| 283 | ----@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) | 304 | +---@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) |
| 284 | ---@return table Block configuration | 305 | ---@return table Block configuration |
| 285 | function oxwm.bar.block.datetime(config) end | 306 | function oxwm.bar.block.datetime(config) end |
| 286 | 307 | ||
| 287 | ---Create a shell command block | 308 | ---Create a shell command block |
| 288 | ----@param config {format: string, command: string, interval: integer, color: string|integer, underline: boolean} Block configuration | 309 | +---@param config {format: string, command: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 289 | ---@return table Block configuration | 310 | ---@return table Block configuration |
| 290 | function oxwm.bar.block.shell(config) end | 311 | function oxwm.bar.block.shell(config) end |
| 291 | 312 | ||
| 292 | ---Create a static text block | 313 | ---Create a static text block |
| 293 | ----@param config {format: string, text: string, interval: integer, color: string|integer, underline: boolean} Block configuration | 314 | +---@param config {format: string, text: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration |
| 294 | ---@return table Block configuration | 315 | ---@return table Block configuration |
| 295 | function oxwm.bar.block.static(config) end | 316 | function oxwm.bar.block.static(config) end |
| 296 | 317 | ||
| 297 | ---Create a battery status block | 318 | ---Create a battery status block |
| 298 | ----@param config {format: string, charging: string, discharging: string, full: string, interval: integer, color: string|integer, underline: boolean, battery_name: string} Block configuration | 319 | +---@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 |
| 299 | ---@return table Block configuration | 320 | ---@return table Block configuration |
| 300 | function oxwm.bar.block.battery(config) end | 321 | function oxwm.bar.block.battery(config) end |
| 301 | 322 | ||