tony / oxwm

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