tony / oxwm

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