tony / oxwm

Branch: ee118ae
Switch branches/tags
master
tonybanters added default info to default config for toggle-able bar and gestures. a96a42b 24d ago
420 lines · 15.9 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?, width: number?} Rule configuration (`width` is the scrolling layout column width: a proportion at or below 1, otherwise pixels)
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 ---Cycle the focused window through the scrolling width presets
241 ---@param direction integer? 1 for the next preset, -1 for the previous (default 1)
242 ---@return table Action table for keybinding
243 function oxwm.layout.cycle_width(direction) end
244
245 ---Set the focused window's width in the scrolling layout
246 ---@param width number Proportion of the screen (0-1) or pixels (> 1)
247 ---@return table Action table for keybinding
248 function oxwm.layout.set_width(width) end
249
250 ---Scrolling layout module
251 ---@class oxwm.scroll
252 oxwm.scroll = {}
253
254 ---Set the default column width for new windows in the scrolling layout
255 ---@param width number Proportion of the screen (0-1) or pixels (> 1), default 0.5
256 function oxwm.scroll.set_default_width(width) end
257
258 ---Set the width presets cycled by oxwm.layout.cycle_width
259 ---@param presets number[] Up to 8 widths, default { 1/3, 1/2, 2/3 }
260 function oxwm.scroll.set_width_presets(presets) end
261
262 ---Enable or disable touchpad swipe gestures (requires read access to /dev/input)
263 ---@param enabled boolean Default false
264 function oxwm.scroll.set_gesture_enabled(enabled) end
265
266 ---Set how many fingers a swipe needs to scroll the layout
267 ---@param fingers integer 3, 4 or 5 (default 3)
268 function oxwm.scroll.set_gesture_fingers(fingers) end
269
270 ---Set how far the view moves per unit of finger travel
271 ---@param speed number Multiplier, default 2.0
272 function oxwm.scroll.set_gesture_speed(speed) end
273
274 ---Invert the swipe direction so the windows follow the fingers
275 ---@param natural boolean Default false
276 function oxwm.scroll.set_gesture_natural(natural) end
277
278 ---Show a minimap of the scrolling strip in the bar next to the layout symbol
279 ---@param enabled boolean Default true
280 function oxwm.scroll.set_indicator(enabled) end
281
282 ---Set the minimap width
283 ---@param width integer Pixels, 0 = four times the bar height (default)
284 function oxwm.scroll.set_indicator_width(width) end
285
286 ---Tag/workspace management module
287 ---@class oxwm.tag
288 oxwm.tag = {}
289
290 ---View/switch to tag
291 ---@param index integer Tag index (0-based)
292 ---@return table Action table for keybinding
293 function oxwm.tag.view(index) end
294
295 ---View/switch to next tag
296 ---@return table Action table for keybinding
297 function oxwm.tag.view_next() end
298
299 ---View/switch to previous tag
300 ---@return table Action table for keybinding
301 function oxwm.tag.view_previous() end
302
303 ---View/switch to next non-empty tag
304 ---@return table Action table for keybinding
305 function oxwm.tag.view_next_nonempty() end
306
307 ---View/switch to previous non-empty tag
308 ---@return table Action table for keybinding
309 function oxwm.tag.view_previous_nonempty() end
310
311 ---Move focused window to tag
312 ---@param index integer Tag index (0-based)
313 ---@return table Action table for keybinding
314 function oxwm.tag.move_to(index) end
315
316 ---Toggle viewing a tag (allows viewing multiple tags at once)
317 ---@param index integer Tag index (0-based)
318 ---@return table Action table for keybinding
319 function oxwm.tag.toggleview(index) end
320
321 ---Toggle tag on focused window (allows window to appear on multiple tags)
322 ---@param index integer Tag index (0-based)
323 ---@return table Action table for keybinding
324 function oxwm.tag.toggletag(index) end
325
326 ---When enabled an attempt to view the current tag switches back to the previously viewed tag.
327 ---@param enabled boolean Enable or disable tag_back_and_forth
328 function oxwm.tag.set_back_and_forth(enabled) end
329
330 ---Status bar configuration module
331 ---@class oxwm.bar
332 oxwm.bar = {}
333
334 ---Set status bar font
335 ---@param font string Font string (e.g., "monospace:style=Bold:size=10")
336 function oxwm.bar.set_font(font) end
337
338 ---Set status bar position
339 ---@param position string Bar position ("top" or "bottom")
340 function oxwm.bar.set_position(position) end
341
342 ---DEPRECATED: Add a status bar block (use oxwm.bar.set_blocks with block constructors instead)
343 ---@deprecated
344 ---@param format string Format string with {} placeholders
345 ---@param command "DateTime"|"Shell"|"Ram"|"Static" Block command type (Battery not supported)
346 ---@param arg string|nil Command argument (format for DateTime, command for Shell, text for Static, nil for Ram)
347 ---@param interval integer Update interval in seconds
348 ---@param color string|integer Color as hex string or integer
349 ---@param underline boolean Whether to underline the block
350 function oxwm.bar.add_block(format, command, arg, interval, color, underline) end
351
352 ---Set status bar blocks using block constructors
353 ---@param blocks table[] Array of block configurations created with oxwm.bar.block.*
354 function oxwm.bar.set_blocks(blocks) end
355
356 ---Block constructors module
357 ---@class oxwm.bar.block
358 oxwm.bar.block = {}
359
360 ---Create a RAM usage block
361 ---@param config {format: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
362 ---@return table Block configuration
363 function oxwm.bar.block.ram(config) end
364
365 ---Create a date/time block
366 ---@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)
367 ---@return table Block configuration
368 function oxwm.bar.block.datetime(config) end
369
370 ---Create a shell command block
371 ---@param config {format: string, command: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
372 ---@return table Block configuration
373 function oxwm.bar.block.shell(config) end
374
375 ---Create a static text block
376 ---@param config {format: string, text: string, interval: integer, color: string|integer, underline: boolean, click: string|{command: string, floating: boolean?, bypass_rules: boolean?}?} Block configuration
377 ---@return table Block configuration
378 function oxwm.bar.block.static(config) end
379
380 ---Create a battery status block
381 ---@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
382 ---@return table Block configuration
383 function oxwm.bar.block.battery(config) end
384
385 ---Create a system tray block. Including this block enables the tray on the first bar; omitting it disables the tray entirely.
386 ---@param config {color: string|integer, underline: boolean}? Optional appearance config (only color and underline are used)
387 ---@return table Block configuration
388 function oxwm.bar.block.systray(config) end
389
390 ---Set normal tag color scheme (unselected, no windows)
391 ---@param foreground string|integer Foreground color
392 ---@param background string|integer Background color
393 ---@param underline string|integer Underline color
394 function oxwm.bar.set_scheme_normal(foreground, background, underline) end
395
396 ---Set occupied tag color scheme (unselected, has windows)
397 ---@param foreground string|integer Foreground color
398 ---@param background string|integer Background color
399 ---@param underline string|integer Underline color
400 function oxwm.bar.set_scheme_occupied(foreground, background, underline) end
401
402 ---Set selected tag color scheme (currently selected tag)
403 ---@param foreground string|integer Foreground color
404 ---@param background string|integer Background color
405 ---@param underline string|integer Underline color
406 function oxwm.bar.set_scheme_selected(foreground, background, underline) end
407
408 ---Set urgent tag color scheme (tags with urgent windows)
409 ---@param foreground string|integer Foreground color
410 ---@param background string|integer Background color
411 ---@param underline string|integer Underline color
412 function oxwm.bar.set_scheme_urgent(foreground, background, underline) end
413
414 ---Hide tags that have no windows and are not currently selected
415 ---@param hide boolean Whether to hide vacant tags
416 function oxwm.bar.set_hide_vacant_tags(hide) end
417
418 ---Add an autostart command
419 ---@param cmd string Command to run at startup
420 function oxwm.autostart(cmd) end