tony / oxwm

Branch: 3daf041
Switch branches/tags
master
MaliCopter Attach Methods but no hot reload c95e5bb 2026-09-06
374 lines · 14 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 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?} Rule configuration
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 ---Tag/workspace management module
241 ---@class oxwm.tag
242 oxwm.tag = {}
243
244 ---View/switch to tag
245 ---@param index integer Tag index (0-based)
246 ---@return table Action table for keybinding
247 function oxwm.tag.view(index) end
248
249 ---View/switch to next tag
250 ---@return table Action table for keybinding
251 function oxwm.tag.view_next() end
252
253 ---View/switch to previous tag
254 ---@return table Action table for keybinding
255 function oxwm.tag.view_previous() end
256
257 ---View/switch to next non-empty tag
258 ---@return table Action table for keybinding
259 function oxwm.tag.view_next_nonempty() end
260
261 ---View/switch to previous non-empty tag
262 ---@return table Action table for keybinding
263 function oxwm.tag.view_previous_nonempty() end
264
265 ---Move focused window to tag
266 ---@param index integer Tag index (0-based)
267 ---@return table Action table for keybinding
268 function oxwm.tag.move_to(index) end
269
270 ---Toggle viewing a tag (allows viewing multiple tags at once)
271 ---@param index integer Tag index (0-based)
272 ---@return table Action table for keybinding
273 function oxwm.tag.toggleview(index) end
274
275 ---Toggle tag on focused window (allows window to appear on multiple tags)
276 ---@param index integer Tag index (0-based)
277 ---@return table Action table for keybinding
278 function oxwm.tag.toggletag(index) end
279
280 ---When enabled an attempt to view the current tag switches back to the previously viewed tag.
281 ---@param enabled boolean Enable or disable tag_back_and_forth
282 function oxwm.tag.set_back_and_forth(enabled) end
283
284 ---Status bar configuration module
285 ---@class oxwm.bar
286 oxwm.bar = {}
287
288 ---Set status bar font
289 ---@param font string Font string (e.g., "monospace:style=Bold:size=10")
290 function oxwm.bar.set_font(font) end
291
292 ---Set status bar position
293 ---@param position string Bar position ("top" or "bottom")
294 function oxwm.bar.set_position(position) end
295
296 ---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead)
297 ---@deprecated
298 ---@param format string Format string with {} placeholders
299 ---@param command "DateTime"|"Shell"|"Ram"|"Static" Block command type (Battery not supported)
300 ---@param arg string|nil Command argument (format for DateTime, command for Shell, text for Static, nil for Ram)
301 ---@param interval integer Update interval in seconds
302 ---@param color string|integer Color as hex string or integer
303 ---@param underline boolean Whether to underline the block
304 function oxwm.bar.add_block(format, command, arg, interval, color, underline) end
305
306 ---Set status bar blocks using block constructors
307 ---@param blocks table[] Array of block configurations created with oxwm.bar.block.*
308 function oxwm.bar.set_blocks(blocks) end
309
310 ---Block constructors module
311 ---@class oxwm.bar.block
312 oxwm.bar.block = {}
313
314 ---Create a RAM usage block
315 ---@param config {format: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
316 ---@return table Block configuration
317 function oxwm.bar.block.ram(config) end
318
319 ---Create a date/time block
320 ---@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)
321 ---@return table Block configuration
322 function oxwm.bar.block.datetime(config) end
323
324 ---Create a shell command block
325 ---@param config {format: string, command: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
326 ---@return table Block configuration
327 function oxwm.bar.block.shell(config) end
328
329 ---Create a static text block
330 ---@param config {format: string, text: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
331 ---@return table Block configuration
332 function oxwm.bar.block.static(config) end
333
334 ---Create a battery status block
335 ---@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
336 ---@return table Block configuration
337 function oxwm.bar.block.battery(config) end
338
339 ---Create a system tray block. Including this block enables the tray on the first bar; omitting it disables the tray entirely.
340 ---@param config {color: string|integer, underline: boolean}? Optional appearance config (only color and underline are used)
341 ---@return table Block configuration
342 function oxwm.bar.block.systray(config) end
343
344 ---Set normal tag color scheme (unselected, no windows)
345 ---@param foreground string|integer Foreground color
346 ---@param background string|integer Background color
347 ---@param underline string|integer Underline color
348 function oxwm.bar.set_scheme_normal(foreground, background, underline) end
349
350 ---Set occupied tag color scheme (unselected, has windows)
351 ---@param foreground string|integer Foreground color
352 ---@param background string|integer Background color
353 ---@param underline string|integer Underline color
354 function oxwm.bar.set_scheme_occupied(foreground, background, underline) end
355
356 ---Set selected tag color scheme (currently selected tag)
357 ---@param foreground string|integer Foreground color
358 ---@param background string|integer Background color
359 ---@param underline string|integer Underline color
360 function oxwm.bar.set_scheme_selected(foreground, background, underline) end
361
362 ---Set urgent tag color scheme (tags with urgent windows)
363 ---@param foreground string|integer Foreground color
364 ---@param background string|integer Background color
365 ---@param underline string|integer Underline color
366 function oxwm.bar.set_scheme_urgent(foreground, background, underline) end
367
368 ---Hide tags that have no windows and are not currently selected
369 ---@param hide boolean Whether to hide vacant tags
370 function oxwm.bar.set_hide_vacant_tags(hide) end
371
372 ---Add an autostart command
373 ---@param cmd string Command to run at startup
374 function oxwm.autostart(cmd) end