tony / oxwm

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