1 # vim:ts=2:sw=2:expandtab
3 # i3 - an improved dynamic tiling window manager
4 # © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
6 # parser-specs/commands.spec: Specification file for generate-command-parser.pl
7 # which will generate the appropriate header files for our C parser.
9 # Use :source highlighting.vim in vim to get syntax highlighting
13 # We have an end token here for all the commands which just call some
14 # function without using an explicit 'end' token.
16 '[' -> call cmd_criteria_init(); CRITERIA
19 'exit' -> call cmd_exit()
20 'restart' -> call cmd_restart()
21 'reload' -> call cmd_reload()
23 'debuglog' -> DEBUGLOG
26 'append_layout' -> APPEND_LAYOUT
27 'workspace' -> WORKSPACE
30 'open' -> call cmd_open()
31 'fullscreen' -> FULLSCREEN
33 'floating' -> FLOATING
39 'scratchpad' -> SCRATCHPAD
44 ctype = 'class' -> CRITERION
45 ctype = 'instance' -> CRITERION
46 ctype = 'window_role' -> CRITERION
47 ctype = 'con_id' -> CRITERION
48 ctype = 'id' -> CRITERION
49 ctype = 'con_mark' -> CRITERION
50 ctype = 'title' -> CRITERION
51 ctype = 'urgent' -> CRITERION
52 ']' -> call cmd_criteria_match_windows(); INITIAL
59 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
61 # exec [--no-startup-id] <command>
63 nosn = '--no-startup-id'
66 -> call cmd_exec($nosn, $command)
68 # shmlog <size>|toggle|on|off
70 # argument may be a number
72 -> call cmd_shmlog($argument)
74 # debuglog toggle|on|off
76 argument = 'toggle', 'on', 'off'
77 -> call cmd_debuglog($argument)
79 # border normal|none|1pixel|toggle|1pixel
81 border_style = 'normal', 'pixel'
83 border_style = 'none', 'toggle'
84 -> call cmd_border($border_style, "0")
85 border_style = '1pixel'
86 -> call cmd_border($border_style, "1")
90 -> call cmd_border($border_style, "2")
92 -> call cmd_border($border_style, $border_width)
94 # layout default|stacked|stacking|tabbed|splitv|splith
95 # layout toggle [split|all]
97 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
98 -> call cmd_layout($layout_mode)
102 # layout toggle [split|all]
105 -> call cmd_layout_toggle($toggle_mode)
106 toggle_mode = 'split', 'all'
107 -> call cmd_layout_toggle($toggle_mode)
109 # append_layout <path>
111 path = string -> call cmd_append_layout($path)
113 # workspace next|prev|next_on_output|prev_on_output
114 # workspace back_and_forth
116 # workspace number <number>
118 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
119 -> call cmd_workspace($direction)
121 -> call cmd_workspace_back_and_forth()
125 -> call cmd_workspace_name($workspace)
127 state WORKSPACE_NUMBER:
129 -> call cmd_workspace_number($workspace)
131 # focus left|right|up|down
132 # focus output <output>
133 # focus tiling|floating|mode_toggle
137 direction = 'left', 'right', 'up', 'down'
138 -> call cmd_focus_direction($direction)
141 window_mode = 'tiling', 'floating', 'mode_toggle'
142 -> call cmd_focus_window_mode($window_mode)
143 level = 'parent', 'child'
144 -> call cmd_focus_level($level)
150 -> call cmd_focus_output($output)
152 # kill [window|client]
154 kill_mode = 'window', 'client'
155 -> call cmd_kill($kill_mode)
157 -> call cmd_kill($kill_mode)
159 # fullscreen enable|toggle [global]
161 # fullscreen [global]
164 -> call cmd_fullscreen($action, "output")
165 action = 'enable', 'toggle'
170 state FULLSCREEN_MODE:
172 -> call cmd_fullscreen($action, $mode)
174 -> call cmd_fullscreen($action, "output")
176 state FULLSCREEN_COMPAT:
178 -> call cmd_fullscreen("toggle", $mode)
180 -> call cmd_fullscreen("toggle", "output")
182 # split v|h|vertical|horizontal
184 direction = 'horizontal', 'vertical', 'v', 'h'
185 -> call cmd_split($direction)
187 # floating enable|disable|toggle
189 floating = 'enable', 'disable', 'toggle'
190 -> call cmd_floating($floating)
192 # mark [--toggle] <mark>
197 -> call cmd_mark($mark, $toggle)
202 -> call cmd_unmark($mark)
204 -> call cmd_unmark($mark)
208 way = 'grow', 'shrink'
211 state RESIZE_DIRECTION:
212 direction = 'up', 'down', 'left', 'right', 'width', 'height'
219 -> call cmd_resize($way, $direction, "10", "10")
227 -> call cmd_resize($way, $direction, $resize_px, "10")
229 state RESIZE_TILING_OR:
231 -> RESIZE_TILING_FINAL
233 state RESIZE_TILING_FINAL:
235 -> call cmd_resize($way, $direction, $resize_px, $resize_ppt)
237 # rename workspace <name> to <name>
238 # rename workspace to <name>
243 state RENAME_WORKSPACE:
245 -> RENAME_WORKSPACE_LIKELY_TO
247 -> RENAME_WORKSPACE_TO
249 state RENAME_WORKSPACE_LIKELY_TO:
251 -> RENAME_WORKSPACE_NEW_NAME
253 -> call cmd_rename_workspace(NULL, $new_name)
255 state RENAME_WORKSPACE_TO:
257 -> RENAME_WORKSPACE_NEW_NAME
259 state RENAME_WORKSPACE_NEW_NAME:
261 -> call cmd_rename_workspace(NULL, "to")
263 -> call cmd_rename_workspace($old_name, $new_name)
265 # move <direction> [<pixels> [px]]
266 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
267 # move [window|container] [to] output <str>
268 # move [window|container] [to] scratchpad
269 # move workspace to [output] <str>
271 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
284 -> call cmd_move_scratchpad()
285 direction = 'left', 'right', 'up', 'down'
290 -> MOVE_TO_ABSOLUTE_POSITION
292 state MOVE_DIRECTION:
296 -> call cmd_move_direction($direction, "10")
298 state MOVE_DIRECTION_PX:
300 -> call cmd_move_direction($direction, $pixels)
302 -> call cmd_move_direction($direction, $pixels)
304 state MOVE_WORKSPACE:
306 -> MOVE_WORKSPACE_TO_OUTPUT
307 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
308 -> call cmd_move_con_to_workspace($workspace)
310 -> call cmd_move_con_to_workspace_back_and_forth()
312 -> MOVE_WORKSPACE_NUMBER
314 -> call cmd_move_con_to_workspace_name($workspace)
316 state MOVE_WORKSPACE_NUMBER:
318 -> call cmd_move_con_to_workspace_number($number)
320 state MOVE_TO_OUTPUT:
322 -> call cmd_move_con_to_output($output)
324 state MOVE_WORKSPACE_TO_OUTPUT:
328 -> call cmd_move_workspace_to_output($output)
330 state MOVE_TO_ABSOLUTE_POSITION:
334 state MOVE_TO_POSITION:
336 -> call cmd_move_window_to_center($method)
338 -> MOVE_TO_POSITION_X
340 state MOVE_TO_POSITION_X:
344 -> MOVE_TO_POSITION_Y
346 state MOVE_TO_POSITION_Y:
348 -> call cmd_move_window_to_position($method, $coord_x, $coord_y)
353 -> call cmd_mode($mode)
357 -> call cmd_nop($comment)
359 -> call cmd_nop(NULL)
363 -> call cmd_scratchpad_show()
365 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
367 bar_type = 'hidden_state'
372 state BAR_HIDDEN_STATE:
373 bar_value = 'hide', 'show', 'toggle'
377 bar_value = 'dock', 'hide', 'invisible', 'toggle'
384 -> call cmd_bar($bar_type, $bar_value, $bar_id)