tony / oxwm

Branch: 5cb4f4d
Switch branches/tags
master
tonybanters Added docs for oxwm.lua lsp hints. 5cb4f4d 2026-03-30
353 lines · 13 KB Raw Blame History
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 ---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
66 ---Window rule module
67 ---@class oxwm.rule
68 oxwm.rule = {}
69
70 ---Add a window rule
71 ---@param rule {class: string?, instance: string?, title: string?, role: string?, floating: boolean?, tag: integer?, fullscreen: boolean?, focus: boolean?} Rule configuration
72 function oxwm.rule.add(rule) end
73
74 ---Quit the window manager
75 ---@return table Action table for keybinding
76 function oxwm.quit() end
77
78 ---Restart the window manager
79 ---@return table Action table for keybinding
80 function oxwm.restart() end
81
82 ---Recompile the window manager
83 ---@return table Action table for keybinding
84 function oxwm.recompile() end
85
86 ---Toggle gaps on/off
87 ---@return table Action table for keybinding
88 function oxwm.toggle_gaps() end
89
90 ---Show keybind overlay
91 ---@return table Action table for keybinding
92 function oxwm.show_keybinds() end
93
94 ---Set master area factor (adjust master window width in tiling layout)
95 ---@param delta integer Delta to adjust by (negative to decrease, positive to increase)
96 ---@return table Action table for keybinding
97 function oxwm.set_master_factor(delta) end
98
99 ---Increment/decrement number of master windows
100 ---@param delta integer Delta to adjust by (negative to decrease, positive to increase)
101 ---@return table Action table for keybinding
102 function oxwm.inc_num_master(delta) end
103
104 ---Keybinding module
105 ---@class oxwm.key
106 oxwm.key = {}
107
108 ---Bind a key combination to an action
109 ---@param modifiers string|string[] Modifier keys (e.g., {"Mod4"}, {"Mod4", "Shift"})
110 ---@param key string Key name (e.g., "Return", "Q", "1")
111 ---@param action table Action returned by oxwm functions
112 function oxwm.key.bind(modifiers, key, action) end
113
114 ---Bind a keychord (multi-key sequence) to an action
115 ---@param keys table[] Array of key presses, each: {{modifiers}, key}
116 ---@param action table Action returned by oxwm functions
117 function oxwm.key.chord(keys, action) end
118
119 ---Gap configuration module
120 ---@class oxwm.gaps
121 oxwm.gaps = {}
122
123 ---Set gaps enabled/disabled
124 ---@param enabled boolean Enable or disable gaps
125 function oxwm.gaps.set_enabled(enabled) end
126
127 ---Enable gaps
128 function oxwm.gaps.enable() end
129
130 ---Disable gaps
131 function oxwm.gaps.disable() end
132
133 ---Set inner gaps
134 ---@param horizontal integer Horizontal inner gap in pixels
135 ---@param vertical integer Vertical inner gap in pixels
136 function oxwm.gaps.set_inner(horizontal, vertical) end
137
138 ---Set outer gaps
139 ---@param horizontal integer Horizontal outer gap in pixels
140 ---@param vertical integer Vertical outer gap in pixels
141 function oxwm.gaps.set_outer(horizontal, vertical) end
142
143 ---Set smart gaps (disable outer gaps when only one window visible)
144 ---@param enabled boolean Enable or disable smart gaps
145 function oxwm.gaps.set_smart(enabled) end
146
147 ---Border configuration module
148 ---@class oxwm.border
149 oxwm.border = {}
150
151 ---Set border width
152 ---@param width integer Border width in pixels
153 function oxwm.border.set_width(width) end
154
155 ---Set focused window border color
156 ---@param color string|integer Color as hex string ("#ff0000", "0xff0000") or integer
157 function oxwm.border.set_focused_color(color) end
158
159 ---Set unfocused window border color
160 ---@param color string|integer Color as hex string ("#666666", "0x666666") or integer
161 function oxwm.border.set_unfocused_color(color) end
162
163 ---Client/window management module
164 ---@class oxwm.client
165 oxwm.client = {}
166
167 ---Kill the focused window
168 ---@return table Action table for keybinding
169 function oxwm.client.kill() end
170
171 ---Toggle fullscreen mode
172 ---@return table Action table for keybinding
173 function oxwm.client.toggle_fullscreen() end
174
175 ---Toggle floating mode
176 ---@return table Action table for keybinding
177 function oxwm.client.toggle_floating() end
178
179 ---Focus stack (next/previous window)
180 ---@param dir integer Direction (1 for next, -1 for previous)
181 ---@return table Action table for keybinding
182 function oxwm.client.focus_stack(dir) end
183
184 ---Move stack (next/previous window)
185 ---@param dir integer Direction (1 for next, -1 for previous)
186 ---@return table Action table for keybinding
187 function oxwm.client.move_stack(dir) end
188
189 ---Monitor management module
190 ---@class oxwm.monitor
191 oxwm.monitor = {}
192
193 ---Focus monitor
194 ---@param dir integer Direction (-1 for previous, 1 for next)
195 ---@return table Action table for keybinding
196 function oxwm.monitor.focus(dir) end
197
198 ---Send focused window to monitor
199 ---@param dir integer Direction (-1 for previous, 1 for next)
200 ---@return table Action table for keybinding
201 function oxwm.monitor.tag(dir) end
202
203 ---Layout management module
204 ---@class oxwm.layout
205 oxwm.layout = {}
206
207 ---Cycle through layouts
208 ---@return table Action table for keybinding
209 function oxwm.layout.cycle() end
210
211 ---Set specific layout
212 ---@param name string Layout name (e.g., "tiling", "normie", "tabbed", "grid", "monocle", "scrolling")
213 ---@return table Action table for keybinding
214 function oxwm.layout.set(name) end
215
216 ---Scroll layout left (for scrolling layout)
217 ---@return table Action table for keybinding
218 function oxwm.layout.scroll_left() end
219
220 ---Scroll layout right (for scrolling layout)
221 ---@return table Action table for keybinding
222 function oxwm.layout.scroll_right() end
223
224 ---Tag/workspace management module
225 ---@class oxwm.tag
226 oxwm.tag = {}
227
228 ---View/switch to tag
229 ---@param index integer Tag index (0-based)
230 ---@return table Action table for keybinding
231 function oxwm.tag.view(index) end
232
233 ---View/switch to next tag
234 ---@return table Action table for keybinding
235 function oxwm.tag.view_next() end
236
237 ---View/switch to previous tag
238 ---@return table Action table for keybinding
239 function oxwm.tag.view_previous() end
240
241 ---View/switch to next non-empty tag
242 ---@return table Action table for keybinding
243 function oxwm.tag.view_next_nonempty() end
244
245 ---View/switch to previous non-empty tag
246 ---@return table Action table for keybinding
247 function oxwm.tag.view_previous_nonempty() end
248
249 ---Move focused window to tag
250 ---@param index integer Tag index (0-based)
251 ---@return table Action table for keybinding
252 function oxwm.tag.move_to(index) end
253
254 ---Toggle viewing a tag (allows viewing multiple tags at once)
255 ---@param index integer Tag index (0-based)
256 ---@return table Action table for keybinding
257 function oxwm.tag.toggleview(index) end
258
259 ---Toggle tag on focused window (allows window to appear on multiple tags)
260 ---@param index integer Tag index (0-based)
261 ---@return table Action table for keybinding
262 function oxwm.tag.toggletag(index) end
263
264 ---When enabled an attempt to view the current tag switches back to the previously viewed tag.
265 ---@param enabled boolean Enable or disable tag_back_and_forth
266 function oxwm.tag.set_back_and_forth(enabled) end
267
268 ---Status bar configuration module
269 ---@class oxwm.bar
270 oxwm.bar = {}
271
272 ---Set status bar font
273 ---@param font string Font string (e.g., "monospace:style=Bold:size=10")
274 function oxwm.bar.set_font(font) end
275
276 ---Set status bar position
277 ---@param position string Bar position ("top" or "bottom")
278 function oxwm.bar.set_position(position) end
279
280 ---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead)
281 ---@deprecated
282 ---@param format string Format string with {} placeholders
283 ---@param command "DateTime"|"Shell"|"Ram"|"Static" Block command type (Battery not supported)
284 ---@param arg string|nil Command argument (format for DateTime, command for Shell, text for Static, nil for Ram)
285 ---@param interval integer Update interval in seconds
286 ---@param color string|integer Color as hex string or integer
287 ---@param underline boolean Whether to underline the block
288 function oxwm.bar.add_block(format, command, arg, interval, color, underline) end
289
290 ---Set status bar blocks using block constructors
291 ---@param blocks table[] Array of block configurations created with oxwm.bar.block.*
292 function oxwm.bar.set_blocks(blocks) end
293
294 ---Block constructors module
295 ---@class oxwm.bar.block
296 oxwm.bar.block = {}
297
298 ---Create a RAM usage block
299 ---@param config {format: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
300 ---@return table Block configuration
301 function oxwm.bar.block.ram(config) end
302
303 ---Create a date/time block
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)
305 ---@return table Block configuration
306 function oxwm.bar.block.datetime(config) end
307
308 ---Create a shell command block
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
310 ---@return table Block configuration
311 function oxwm.bar.block.shell(config) end
312
313 ---Create a static text block
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
315 ---@return table Block configuration
316 function oxwm.bar.block.static(config) end
317
318 ---Create a battery status block
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
320 ---@return table Block configuration
321 function oxwm.bar.block.battery(config) end
322
323 ---Set normal tag color scheme (unselected, no windows)
324 ---@param foreground string|integer Foreground color
325 ---@param background string|integer Background color
326 ---@param underline string|integer Underline color
327 function oxwm.bar.set_scheme_normal(foreground, background, underline) end
328
329 ---Set occupied tag color scheme (unselected, has windows)
330 ---@param foreground string|integer Foreground color
331 ---@param background string|integer Background color
332 ---@param underline string|integer Underline color
333 function oxwm.bar.set_scheme_occupied(foreground, background, underline) end
334
335 ---Set selected tag color scheme (currently selected tag)
336 ---@param foreground string|integer Foreground color
337 ---@param background string|integer Background color
338 ---@param underline string|integer Underline color
339 function oxwm.bar.set_scheme_selected(foreground, background, underline) end
340
341 ---Set urgent tag color scheme (tags with urgent windows)
342 ---@param foreground string|integer Foreground color
343 ---@param background string|integer Background color
344 ---@param underline string|integer Underline color
345 function oxwm.bar.set_scheme_urgent(foreground, background, underline) end
346
347 ---Hide tags that have no windows and are not currently selected
348 ---@param hide boolean Whether to hide vacant tags
349 function oxwm.bar.set_hide_vacant_tags(hide) end
350
351 ---Add an autostart command
352 ---@param cmd string Command to run at startup
353 function oxwm.autostart(cmd) end