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()
24 'append_layout' -> APPEND_LAYOUT
25 'workspace' -> WORKSPACE
28 'open' -> call cmd_open()
29 'fullscreen' -> FULLSCREEN
31 'floating' -> FLOATING
36 'scratchpad' -> SCRATCHPAD
40 ctype = 'class' -> CRITERION
41 ctype = 'instance' -> CRITERION
42 ctype = 'window_role' -> CRITERION
43 ctype = 'con_id' -> CRITERION
44 ctype = 'id' -> CRITERION
45 ctype = 'con_mark' -> CRITERION
46 ctype = 'title' -> CRITERION
47 ctype = 'urgent' -> CRITERION
48 ']' -> call cmd_criteria_match_windows(); INITIAL
55 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
57 # exec [--no-startup-id] <command>
59 nosn = '--no-startup-id'
62 -> call cmd_exec($nosn, $command)
64 # border normal|none|1pixel|toggle
66 border_style = 'normal', 'none', '1pixel', 'toggle'
67 -> call cmd_border($border_style)
69 # layout default|stacked|stacking|tabbed
71 layout_mode = 'default', 'stacked', 'stacking', 'tabbed'
72 -> call cmd_layout($layout_mode)
74 # append_layout <path>
76 path = string -> call cmd_append_layout($path)
78 # workspace next|prev|next_on_output|prev_on_output
79 # workspace back_and_forth
81 # workspace number <number>
83 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
84 -> call cmd_workspace($direction)
86 -> call cmd_workspace_back_and_forth()
90 -> call cmd_workspace_name($workspace)
92 state WORKSPACE_NUMBER:
94 -> call cmd_workspace_number($workspace)
96 # focus left|right|up|down
97 # focus output <output>
98 # focus tiling|floating|mode_toggle
102 direction = 'left', 'right', 'up', 'down'
103 -> call cmd_focus_direction($direction)
106 window_mode = 'tiling', 'floating', 'mode_toggle'
107 -> call cmd_focus_window_mode($window_mode)
108 level = 'parent', 'child'
109 -> call cmd_focus_level($level)
115 -> call cmd_focus_output($output)
117 # kill [window|client]
119 kill_mode = 'window', 'client'
120 -> call cmd_kill($kill_mode)
122 -> call cmd_kill($kill_mode)
124 # fullscreen [global]
126 fullscreen_mode = 'global'
127 -> call cmd_fullscreen($fullscreen_mode)
129 -> call cmd_fullscreen($fullscreen_mode)
131 # split v|h|vertical|horizontal
133 direction = 'v', 'h', 'vertical', 'horizontal'
134 -> call cmd_split($direction)
136 # floating enable|disable|toggle
138 floating = 'enable', 'disable', 'toggle'
139 -> call cmd_floating($floating)
144 -> call cmd_mark($mark)
148 way = 'grow', 'shrink'
151 state RESIZE_DIRECTION:
152 direction = 'up', 'down', 'left', 'right', 'width', 'height'
159 -> call cmd_resize($way, $direction, "10", "10")
167 -> call cmd_resize($way, $direction, $resize_px, "10")
169 state RESIZE_TILING_OR:
175 -> call cmd_resize($way, $direction, $resize_px, $resize_ppt)
177 # rename workspace <name> to <name>
182 state RENAME_WORKSPACE:
184 -> RENAME_WORKSPACE_TO
186 state RENAME_WORKSPACE_TO:
190 -> call cmd_rename_workspace($old_name, $new_name)
192 # move <direction> [<pixels> [px]]
193 # move [window|container] [to] workspace <str>
194 # move [window|container] [to] output <str>
195 # move [window|container] [to] scratchpad
196 # move workspace to [output] <str>
198 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
211 -> call cmd_move_scratchpad()
212 direction = 'left', 'right', 'up', 'down'
217 -> MOVE_TO_ABSOLUTE_POSITION
219 state MOVE_DIRECTION:
223 -> call cmd_move_direction($direction, "10")
225 state MOVE_DIRECTION_PX:
227 -> call cmd_move_direction($direction, $pixels)
229 -> call cmd_move_direction($direction, $pixels)
231 state MOVE_WORKSPACE:
233 -> MOVE_WORKSPACE_TO_OUTPUT
234 workspace = 'next', 'prev', 'next_on_output', 'prev_on_output'
235 -> call cmd_move_con_to_workspace($workspace)
237 -> MOVE_WORKSPACE_NUMBER
239 -> call cmd_move_con_to_workspace_name($workspace)
241 state MOVE_WORKSPACE_NUMBER:
243 -> call cmd_move_con_to_workspace_number($number)
245 state MOVE_TO_OUTPUT:
247 -> call cmd_move_con_to_output($output)
249 state MOVE_WORKSPACE_TO_OUTPUT:
253 -> call cmd_move_workspace_to_output($output)
255 state MOVE_TO_ABSOLUTE_POSITION:
259 state MOVE_TO_POSITION:
261 -> call cmd_move_window_to_center($method)
263 -> MOVE_TO_POSITION_X
265 state MOVE_TO_POSITION_X:
269 -> MOVE_TO_POSITION_Y
271 state MOVE_TO_POSITION_Y:
273 -> call cmd_move_window_to_position($method, $coord_x, $coord_y)
278 -> call cmd_mode($mode)
282 -> call cmd_nop($comment)
286 -> call cmd_scratchpad_show()