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
41 'title_format' -> TITLE_FORMAT
46 ctype = 'class' -> CRITERION
47 ctype = 'instance' -> CRITERION
48 ctype = 'window_role' -> CRITERION
49 ctype = 'con_id' -> CRITERION
50 ctype = 'id' -> CRITERION
51 ctype = 'window_type' -> CRITERION
52 ctype = 'con_mark' -> CRITERION
53 ctype = 'title' -> CRITERION
54 ctype = 'urgent' -> CRITERION
55 ctype = 'workspace' -> CRITERION
56 ']' -> call cmd_criteria_match_windows(); INITIAL
63 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
65 # exec [--no-startup-id] <command>
67 nosn = '--no-startup-id'
70 -> call cmd_exec($nosn, $command)
72 # shmlog <size>|toggle|on|off
74 # argument may be a number
76 -> call cmd_shmlog($argument)
78 # debuglog toggle|on|off
80 argument = 'toggle', 'on', 'off'
81 -> call cmd_debuglog($argument)
83 # border normal|pixel [<n>]
84 # border none|1pixel|toggle
86 border_style = 'normal', 'pixel'
88 border_style = 'none', 'toggle'
89 -> call cmd_border($border_style, 0)
90 border_style = '1pixel'
91 -> call cmd_border($border_style, 1)
95 -> call cmd_border($border_style, 2)
97 -> call cmd_border($border_style, &border_width)
99 # layout default|stacked|stacking|tabbed|splitv|splith
100 # layout toggle [split|all]
102 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
103 -> call cmd_layout($layout_mode)
107 # layout toggle [split|all]
110 -> call cmd_layout_toggle($toggle_mode)
111 toggle_mode = 'split', 'all'
112 -> call cmd_layout_toggle($toggle_mode)
114 # append_layout <path>
116 path = string -> call cmd_append_layout($path)
118 # workspace next|prev|next_on_output|prev_on_output
119 # workspace back_and_forth
120 # workspace [--no-auto-back-and-forth] <name>
121 # workspace [--no-auto-back-and-forth] number <number>
123 no_auto_back_and_forth = '--no-auto-back-and-forth'
125 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
126 -> call cmd_workspace($direction)
128 -> call cmd_workspace_back_and_forth()
132 -> call cmd_workspace_name($workspace, $no_auto_back_and_forth)
134 state WORKSPACE_NUMBER:
136 -> call cmd_workspace_number($workspace, $no_auto_back_and_forth)
138 # focus left|right|up|down
139 # focus output <output>
140 # focus tiling|floating|mode_toggle
144 direction = 'left', 'right', 'up', 'down'
145 -> call cmd_focus_direction($direction)
148 window_mode = 'tiling', 'floating', 'mode_toggle'
149 -> call cmd_focus_window_mode($window_mode)
150 level = 'parent', 'child'
151 -> call cmd_focus_level($level)
157 -> call cmd_focus_output($output)
159 # kill [window|client]
161 kill_mode = 'window', 'client'
162 -> call cmd_kill($kill_mode)
164 -> call cmd_kill($kill_mode)
166 # fullscreen enable|toggle [global]
168 # fullscreen [global]
171 -> call cmd_fullscreen($action, "output")
172 action = 'enable', 'toggle'
177 state FULLSCREEN_MODE:
179 -> call cmd_fullscreen($action, $mode)
181 -> call cmd_fullscreen($action, "output")
183 state FULLSCREEN_COMPAT:
185 -> call cmd_fullscreen("toggle", $mode)
187 -> call cmd_fullscreen("toggle", "output")
189 # sticky enable|disable|toggle
191 action = 'enable', 'disable', 'toggle'
192 -> call cmd_sticky($action)
194 # split v|h|t|vertical|horizontal|toggle
196 direction = 'horizontal', 'vertical', 'toggle', 'v', 'h', 't'
197 -> call cmd_split($direction)
199 # floating enable|disable|toggle
201 floating = 'enable', 'disable', 'toggle'
202 -> call cmd_floating($floating)
204 # mark [--add|--replace] [--toggle] <mark>
206 mode = '--add', '--replace'
211 -> call cmd_mark($mark, $mode, $toggle)
216 -> call cmd_unmark($mark)
218 -> call cmd_unmark($mark)
222 way = 'grow', 'shrink'
227 state RESIZE_DIRECTION:
228 direction = 'up', 'down', 'left', 'right', 'width', 'height'
235 -> call cmd_resize($way, $direction, 10, 10)
243 -> call cmd_resize($way, $direction, &resize_px, 10)
245 state RESIZE_TILING_OR:
247 -> RESIZE_TILING_FINAL
249 state RESIZE_TILING_FINAL:
251 -> call cmd_resize($way, $direction, &resize_px, &resize_ppt)
265 -> call cmd_resize_set(&width, &height)
267 # rename workspace <name> to <name>
268 # rename workspace to <name>
273 state RENAME_WORKSPACE:
275 -> RENAME_WORKSPACE_LIKELY_TO
277 -> RENAME_WORKSPACE_TO
279 state RENAME_WORKSPACE_LIKELY_TO:
281 -> RENAME_WORKSPACE_NEW_NAME
283 -> call cmd_rename_workspace(NULL, $new_name)
285 state RENAME_WORKSPACE_TO:
287 -> RENAME_WORKSPACE_NEW_NAME
289 state RENAME_WORKSPACE_NEW_NAME:
291 -> call cmd_rename_workspace(NULL, "to")
293 -> call cmd_rename_workspace($old_name, $new_name)
295 # move <direction> [<pixels> [px]]
296 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
297 # move [window|container] [to] output <str>
298 # move [window|container] [to] mark <str>
299 # move [window|container] [to] scratchpad
300 # move workspace to [output] <str>
302 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
303 # move [window|container] [to] position mouse|cursor|pointer
311 no_auto_back_and_forth = '--no-auto-back-and-forth'
320 -> call cmd_move_scratchpad()
321 direction = 'left', 'right', 'up', 'down'
326 -> MOVE_TO_ABSOLUTE_POSITION
328 state MOVE_DIRECTION:
332 -> call cmd_move_direction($direction, 10)
334 state MOVE_DIRECTION_PX:
336 -> call cmd_move_direction($direction, &pixels)
338 -> call cmd_move_direction($direction, &pixels)
340 state MOVE_WORKSPACE:
342 -> MOVE_WORKSPACE_TO_OUTPUT
343 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
344 -> call cmd_move_con_to_workspace($workspace)
346 -> call cmd_move_con_to_workspace_back_and_forth()
348 -> MOVE_WORKSPACE_NUMBER
350 -> call cmd_move_con_to_workspace_name($workspace, $no_auto_back_and_forth)
352 state MOVE_WORKSPACE_NUMBER:
354 -> call cmd_move_con_to_workspace_number($number, $no_auto_back_and_forth)
356 state MOVE_TO_OUTPUT:
358 -> call cmd_move_con_to_output($output)
362 -> call cmd_move_con_to_mark($mark)
364 state MOVE_WORKSPACE_TO_OUTPUT:
368 -> call cmd_move_workspace_to_output($output)
370 state MOVE_TO_ABSOLUTE_POSITION:
374 state MOVE_TO_POSITION:
376 -> call cmd_move_window_to_center($method)
377 'mouse', 'cursor', 'pointer'
378 -> call cmd_move_window_to_mouse()
380 -> MOVE_TO_POSITION_X
382 state MOVE_TO_POSITION_X:
386 -> MOVE_TO_POSITION_Y
388 state MOVE_TO_POSITION_Y:
390 -> call cmd_move_window_to_position($method, &coord_x, &coord_y)
395 -> call cmd_mode($mode)
399 -> call cmd_nop($comment)
401 -> call cmd_nop(NULL)
405 -> call cmd_scratchpad_show()
409 -> call cmd_title_format($format)
411 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
413 bar_type = 'hidden_state'
418 state BAR_HIDDEN_STATE:
419 bar_value = 'hide', 'show', 'toggle'
423 bar_value = 'dock', 'hide', 'invisible', 'toggle'
430 -> call cmd_bar($bar_type, $bar_value, $bar_id)