1 # vim:ts=2:sw=2:expandtab
3 # i3 - an improved dynamic tiling window manager
4 # © 2009 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
34 'floating' -> FLOATING
40 'scratchpad' -> SCRATCHPAD
42 'title_format' -> TITLE_FORMAT
47 ctype = 'class' -> CRITERION
48 ctype = 'instance' -> CRITERION
49 ctype = 'window_role' -> CRITERION
50 ctype = 'con_id' -> CRITERION
51 ctype = 'id' -> CRITERION
52 ctype = 'window_type' -> CRITERION
53 ctype = 'con_mark' -> CRITERION
54 ctype = 'title' -> CRITERION
55 ctype = 'urgent' -> CRITERION
56 ctype = 'workspace' -> CRITERION
57 ctype = 'tiling', 'floating'
58 -> call cmd_criteria_add($ctype, NULL); CRITERIA
59 ']' -> call cmd_criteria_match_windows(); INITIAL
66 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
68 # exec [--no-startup-id] <command>
70 nosn = '--no-startup-id'
73 -> call cmd_exec($nosn, $command)
75 # shmlog <size>|toggle|on|off
77 # argument may be a number
79 -> call cmd_shmlog($argument)
81 # debuglog toggle|on|off
83 argument = 'toggle', 'on', 'off'
84 -> call cmd_debuglog($argument)
86 # border normal|pixel [<n>]
87 # border none|1pixel|toggle
89 border_style = 'normal', 'pixel'
91 border_style = 'none', 'toggle'
92 -> call cmd_border($border_style, 0)
93 border_style = '1pixel'
94 -> call cmd_border($border_style, 1)
98 -> call cmd_border($border_style, 2)
100 -> call cmd_border($border_style, &border_width)
102 # layout default|stacked|stacking|tabbed|splitv|splith
103 # layout toggle [split|all]
105 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
106 -> call cmd_layout($layout_mode)
110 # layout toggle [split|all]
113 -> call cmd_layout_toggle($toggle_mode)
115 -> call cmd_layout_toggle($toggle_mode)
117 # append_layout <path>
119 path = string -> call cmd_append_layout($path)
121 # workspace next|prev|next_on_output|prev_on_output
122 # workspace back_and_forth
123 # workspace [--no-auto-back-and-forth] <name>
124 # workspace [--no-auto-back-and-forth] number <number>
126 no_auto_back_and_forth = '--no-auto-back-and-forth'
128 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
129 -> call cmd_workspace($direction)
131 -> call cmd_workspace_back_and_forth()
135 -> call cmd_workspace_name($workspace, $no_auto_back_and_forth)
137 state WORKSPACE_NUMBER:
139 -> call cmd_workspace_number($workspace, $no_auto_back_and_forth)
141 # focus left|right|up|down
142 # focus output <output>
143 # focus tiling|floating|mode_toggle
147 direction = 'left', 'right', 'up', 'down'
148 -> call cmd_focus_direction($direction)
151 window_mode = 'tiling', 'floating', 'mode_toggle'
152 -> call cmd_focus_window_mode($window_mode)
153 level = 'parent', 'child'
154 -> call cmd_focus_level($level)
160 -> call cmd_focus_output($output)
162 # kill [window|client]
164 kill_mode = 'window', 'client'
165 -> call cmd_kill($kill_mode)
167 -> call cmd_kill($kill_mode)
169 # fullscreen enable|toggle [global]
171 # fullscreen [global]
174 -> call cmd_fullscreen($action, "output")
175 action = 'enable', 'toggle'
180 state FULLSCREEN_MODE:
182 -> call cmd_fullscreen($action, $mode)
184 -> call cmd_fullscreen($action, "output")
186 state FULLSCREEN_COMPAT:
188 -> call cmd_fullscreen("toggle", $mode)
190 -> call cmd_fullscreen("toggle", "output")
192 # sticky enable|disable|toggle
194 action = 'enable', 'disable', 'toggle'
195 -> call cmd_sticky($action)
197 # split v|h|t|vertical|horizontal|toggle
199 direction = 'horizontal', 'vertical', 'toggle', 'v', 'h', 't'
200 -> call cmd_split($direction)
202 # floating enable|disable|toggle
204 floating = 'enable', 'disable', 'toggle'
205 -> call cmd_floating($floating)
207 # mark [--add|--replace] [--toggle] <mark>
209 mode = '--add', '--replace'
214 -> call cmd_mark($mark, $mode, $toggle)
219 -> call cmd_unmark($mark)
221 -> call cmd_unmark($mark)
225 way = 'grow', 'shrink'
230 state RESIZE_DIRECTION:
231 direction = 'up', 'down', 'left', 'right', 'width', 'height'
238 -> call cmd_resize($way, $direction, 10, 10)
246 -> call cmd_resize($way, $direction, &resize_px, 10)
248 state RESIZE_TILING_OR:
250 -> RESIZE_TILING_FINAL
252 state RESIZE_TILING_FINAL:
254 -> call cmd_resize($way, $direction, &resize_px, &resize_ppt)
261 mode_width = 'px', 'ppt'
267 mode_height = 'px', 'ppt'
270 -> call cmd_resize_set(&width, $mode_width, &height, $mode_height)
272 # rename workspace <name> to <name>
273 # rename workspace to <name>
278 state RENAME_WORKSPACE:
280 -> RENAME_WORKSPACE_LIKELY_TO
282 -> RENAME_WORKSPACE_TO
284 state RENAME_WORKSPACE_LIKELY_TO:
286 -> RENAME_WORKSPACE_LIKELY_TO_NEW_NAME
288 -> call cmd_rename_workspace(NULL, $new_name)
290 state RENAME_WORKSPACE_LIKELY_TO_NEW_NAME:
292 -> call cmd_rename_workspace("to", $new_name)
294 -> call cmd_rename_workspace(NULL, "to")
296 state RENAME_WORKSPACE_TO:
298 -> RENAME_WORKSPACE_TO_NEW_NAME
300 state RENAME_WORKSPACE_TO_NEW_NAME:
302 -> call cmd_rename_workspace($old_name, $new_name)
304 # move <direction> [<pixels> [px]]
305 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
306 # move [window|container] [to] output <str>
307 # move [window|container] [to] mark <str>
308 # move [window|container] [to] scratchpad
309 # move workspace to [output] <str>
311 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
312 # move [window|container] [to] position mouse|cursor|pointer
320 no_auto_back_and_forth = '--no-auto-back-and-forth'
329 -> call cmd_move_scratchpad()
330 direction = 'left', 'right', 'up', 'down'
335 -> MOVE_TO_ABSOLUTE_POSITION
337 state MOVE_DIRECTION:
341 -> call cmd_move_direction($direction, 10)
343 state MOVE_DIRECTION_PX:
345 -> call cmd_move_direction($direction, &pixels)
347 -> call cmd_move_direction($direction, &pixels)
349 state MOVE_WORKSPACE:
351 -> MOVE_WORKSPACE_TO_OUTPUT
352 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
353 -> call cmd_move_con_to_workspace($workspace)
355 -> call cmd_move_con_to_workspace_back_and_forth()
357 -> MOVE_WORKSPACE_NUMBER
359 -> call cmd_move_con_to_workspace_name($workspace, $no_auto_back_and_forth)
361 state MOVE_WORKSPACE_NUMBER:
363 -> call cmd_move_con_to_workspace_number($number, $no_auto_back_and_forth)
365 state MOVE_TO_OUTPUT:
367 -> call cmd_move_con_to_output($output)
371 -> call cmd_move_con_to_mark($mark)
373 state MOVE_WORKSPACE_TO_OUTPUT:
377 -> call cmd_move_workspace_to_output($output)
379 state MOVE_TO_ABSOLUTE_POSITION:
383 state MOVE_TO_POSITION:
385 -> call cmd_move_window_to_center($method)
386 'mouse', 'cursor', 'pointer'
387 -> call cmd_move_window_to_mouse()
389 -> MOVE_TO_POSITION_X
391 state MOVE_TO_POSITION_X:
395 -> MOVE_TO_POSITION_Y
397 state MOVE_TO_POSITION_Y:
399 -> call cmd_move_window_to_position(&coord_x, &coord_y)
404 -> call cmd_mode($mode)
408 -> call cmd_nop($comment)
410 -> call cmd_nop(NULL)
414 -> call cmd_scratchpad_show()
416 # swap [container] [with] id <window>
417 # swap [container] [with] con_id <con_id>
418 # swap [container] [with] mark <mark>
424 mode = 'id', 'con_id', 'mark'
429 -> call cmd_swap($mode, $arg)
433 -> call cmd_title_format($format)
435 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
437 bar_type = 'hidden_state'
442 state BAR_HIDDEN_STATE:
443 bar_value = 'hide', 'show', 'toggle'
447 bar_value = 'dock', 'hide', 'invisible', 'toggle'
454 -> call cmd_bar($bar_type, $bar_value, $bar_id)