tony / oxwm

Branch: 5d148df
Switch branches/tags
master
tonybtw Lua Api. 5d148df 2025-11-12
213 lines · 6.9 KB Raw Blame History
1 ---@meta
2
3 ---OXWM Configuration API
4 ---@class oxwm
5 oxwm = {}
6
7 ---Spawn a command
8 ---@param cmd string|string[] Command to spawn (string or array of strings)
9 ---@return table Action table for keybinding
10 function oxwm.spawn(cmd) end
11
12 ---Set the terminal emulator
13 ---@param terminal string Terminal command (e.g., "st", "alacritty")
14 function oxwm.set_terminal(terminal) end
15
16 ---Set the modifier key
17 ---@param modkey string Modifier key ("Mod1", "Mod4", "Shift", "Control")
18 function oxwm.set_modkey(modkey) end
19
20 ---Set workspace tags
21 ---@param tags string[] Array of tag names
22 function oxwm.set_tags(tags) end
23
24 ---Set layout symbol override
25 ---@param name string Layout name (e.g., "tiling", "normie")
26 ---@param symbol string Symbol to display (e.g., "[T]", "[F]")
27 function oxwm.set_layout_symbol(name, symbol) end
28
29 ---Quit the window manager
30 ---@return table Action table for keybinding
31 function oxwm.quit() end
32
33 ---Restart the window manager
34 ---@return table Action table for keybinding
35 function oxwm.restart() end
36
37 ---Recompile the window manager
38 ---@return table Action table for keybinding
39 function oxwm.recompile() end
40
41 ---Toggle gaps on/off
42 ---@return table Action table for keybinding
43 function oxwm.toggle_gaps() end
44
45 ---Show keybind overlay
46 ---@return table Action table for keybinding
47 function oxwm.show_keybinds() end
48
49 ---Focus monitor by index
50 ---@param index integer Monitor index (-1 for previous, 1 for next)
51 ---@return table Action table for keybinding
52 function oxwm.focus_monitor(index) end
53
54 ---Keybinding module
55 ---@class oxwm.key
56 oxwm.key = {}
57
58 ---Bind a key combination to an action
59 ---@param modifiers string|string[] Modifier keys (e.g., {"Mod4"}, {"Mod4", "Shift"})
60 ---@param key string Key name (e.g., "Return", "Q", "1")
61 ---@param action table Action returned by oxwm functions
62 function oxwm.key.bind(modifiers, key, action) end
63
64 ---Bind a keychord (multi-key sequence) to an action
65 ---@param keys table[] Array of key presses, each: {{modifiers}, key}
66 ---@param action table Action returned by oxwm functions
67 function oxwm.key.chord(keys, action) end
68
69 ---Gap configuration module
70 ---@class oxwm.gaps
71 oxwm.gaps = {}
72
73 ---Set gaps enabled/disabled
74 ---@param enabled boolean Enable or disable gaps
75 function oxwm.gaps.set_enabled(enabled) end
76
77 ---Enable gaps
78 function oxwm.gaps.enable() end
79
80 ---Disable gaps
81 function oxwm.gaps.disable() end
82
83 ---Set inner gaps
84 ---@param horizontal integer Horizontal inner gap in pixels
85 ---@param vertical integer Vertical inner gap in pixels
86 function oxwm.gaps.set_inner(horizontal, vertical) end
87
88 ---Set outer gaps
89 ---@param horizontal integer Horizontal outer gap in pixels
90 ---@param vertical integer Vertical outer gap in pixels
91 function oxwm.gaps.set_outer(horizontal, vertical) end
92
93 ---Border configuration module
94 ---@class oxwm.border
95 oxwm.border = {}
96
97 ---Set border width
98 ---@param width integer Border width in pixels
99 function oxwm.border.set_width(width) end
100
101 ---Set focused window border color
102 ---@param color string|integer Color as hex string ("#ff0000", "0xff0000") or integer
103 function oxwm.border.set_focused_color(color) end
104
105 ---Set unfocused window border color
106 ---@param color string|integer Color as hex string ("#666666", "0x666666") or integer
107 function oxwm.border.set_unfocused_color(color) end
108
109 ---Client/window management module
110 ---@class oxwm.client
111 oxwm.client = {}
112
113 ---Kill the focused window
114 ---@return table Action table for keybinding
115 function oxwm.client.kill() end
116
117 ---Toggle fullscreen mode
118 ---@return table Action table for keybinding
119 function oxwm.client.toggle_fullscreen() end
120
121 ---Toggle floating mode
122 ---@return table Action table for keybinding
123 function oxwm.client.toggle_floating() end
124
125 ---Focus window in direction
126 ---@param direction "up"|"down"|"left"|"right" Direction to focus
127 ---@return table Action table for keybinding
128 function oxwm.client.focus_direction(direction) end
129
130 ---Swap window in direction
131 ---@param direction "up"|"down"|"left"|"right" Direction to swap
132 ---@return table Action table for keybinding
133 function oxwm.client.swap_direction(direction) end
134
135 ---Smart move window (move or swap)
136 ---@param direction "up"|"down"|"left"|"right" Direction to move
137 ---@return table Action table for keybinding
138 function oxwm.client.smart_move(direction) end
139
140 ---Focus stack (next/previous window)
141 ---@param dir integer Direction (1 for next, -1 for previous)
142 ---@return table Action table for keybinding
143 function oxwm.client.focus_stack(dir) end
144
145 ---Exchange client positions
146 ---@return table Action table for keybinding
147 function oxwm.client.exchange() end
148
149 ---Layout management module
150 ---@class oxwm.layout
151 oxwm.layout = {}
152
153 ---Cycle through layouts
154 ---@return table Action table for keybinding
155 function oxwm.layout.cycle() end
156
157 ---Set specific layout
158 ---@param name string Layout name (e.g., "tiling", "normie")
159 ---@return table Action table for keybinding
160 function oxwm.layout.set(name) end
161
162 ---Tag/workspace management module
163 ---@class oxwm.tag
164 oxwm.tag = {}
165
166 ---View/switch to tag
167 ---@param index integer Tag index (0-based)
168 ---@return table Action table for keybinding
169 function oxwm.tag.view(index) end
170
171 ---Move focused window to tag
172 ---@param index integer Tag index (0-based)
173 ---@return table Action table for keybinding
174 function oxwm.tag.move_to(index) end
175
176 ---Status bar configuration module
177 ---@class oxwm.bar
178 oxwm.bar = {}
179
180 ---Set status bar font
181 ---@param font string Font string (e.g., "monospace:style=Bold:size=10")
182 function oxwm.bar.set_font(font) end
183
184 ---Add a status bar block
185 ---@param format string Format string with {} placeholders
186 ---@param command "DateTime"|"Shell"|"Ram"|"Static"|"Battery" Block command type
187 ---@param arg string|table|nil Command argument (format for DateTime, command for Shell, text for Static, formats table for Battery, nil for Ram)
188 ---@param interval integer Update interval in seconds
189 ---@param color string|integer Color as hex string or integer
190 ---@param underline boolean Whether to underline the block
191 function oxwm.bar.add_block(format, command, arg, interval, color, underline) end
192
193 ---Set normal tag color scheme (unselected, no windows)
194 ---@param foreground string|integer Foreground color
195 ---@param background string|integer Background color
196 ---@param underline string|integer Underline color
197 function oxwm.bar.set_scheme_normal(foreground, background, underline) end
198
199 ---Set occupied tag color scheme (unselected, has windows)
200 ---@param foreground string|integer Foreground color
201 ---@param background string|integer Background color
202 ---@param underline string|integer Underline color
203 function oxwm.bar.set_scheme_occupied(foreground, background, underline) end
204
205 ---Set selected tag color scheme (currently selected tag)
206 ---@param foreground string|integer Foreground color
207 ---@param background string|integer Background color
208 ---@param underline string|integer Underline color
209 function oxwm.bar.set_scheme_selected(foreground, background, underline) end
210
211 ---Add an autostart command
212 ---@param cmd string Command to run at startup
213 function oxwm.autostart(cmd) end