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 ctype = 'tiling', 'floating'
57 -> call cmd_criteria_add($ctype, NULL); CRITERIA
58 ']' -> call cmd_criteria_match_windows(); INITIAL
65 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
67 # exec [--no-startup-id] <command>
69 nosn = '--no-startup-id'
72 -> call cmd_exec($nosn, $command)
74 # shmlog <size>|toggle|on|off
76 # argument may be a number
78 -> call cmd_shmlog($argument)
80 # debuglog toggle|on|off
82 argument = 'toggle', 'on', 'off'
83 -> call cmd_debuglog($argument)
85 # border normal|pixel [<n>]
86 # border none|1pixel|toggle
88 border_style = 'normal', 'pixel'
90 border_style = 'none', 'toggle'
91 -> call cmd_border($border_style, 0)
92 border_style = '1pixel'
93 -> call cmd_border($border_style, 1)
97 -> call cmd_border($border_style, 2)
99 -> call cmd_border($border_style, &border_width)
101 # layout default|stacked|stacking|tabbed|splitv|splith
102 # layout toggle [split|all]
104 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
105 -> call cmd_layout($layout_mode)
109 # layout toggle [split|all]
112 -> call cmd_layout_toggle($toggle_mode)
114 -> call cmd_layout_toggle($toggle_mode)
116 # append_layout <path>
118 path = string -> call cmd_append_layout($path)
120 # workspace next|prev|next_on_output|prev_on_output
121 # workspace back_and_forth
122 # workspace [--no-auto-back-and-forth] <name>
123 # workspace [--no-auto-back-and-forth] number <number>
125 no_auto_back_and_forth = '--no-auto-back-and-forth'
127 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
128 -> call cmd_workspace($direction)
130 -> call cmd_workspace_back_and_forth()
134 -> call cmd_workspace_name($workspace, $no_auto_back_and_forth)
136 state WORKSPACE_NUMBER:
138 -> call cmd_workspace_number($workspace, $no_auto_back_and_forth)
140 # focus left|right|up|down
141 # focus output <output>
142 # focus tiling|floating|mode_toggle
146 direction = 'left', 'right', 'up', 'down'
147 -> call cmd_focus_direction($direction)
150 window_mode = 'tiling', 'floating', 'mode_toggle'
151 -> call cmd_focus_window_mode($window_mode)
152 level = 'parent', 'child'
153 -> call cmd_focus_level($level)
159 -> call cmd_focus_output($output)
161 # kill [window|client]
163 kill_mode = 'window', 'client'
164 -> call cmd_kill($kill_mode)
166 -> call cmd_kill($kill_mode)
168 # fullscreen enable|toggle [global]
170 # fullscreen [global]
173 -> call cmd_fullscreen($action, "output")
174 action = 'enable', 'toggle'
179 state FULLSCREEN_MODE:
181 -> call cmd_fullscreen($action, $mode)
183 -> call cmd_fullscreen($action, "output")
185 state FULLSCREEN_COMPAT:
187 -> call cmd_fullscreen("toggle", $mode)
189 -> call cmd_fullscreen("toggle", "output")
191 # sticky enable|disable|toggle
193 action = 'enable', 'disable', 'toggle'
194 -> call cmd_sticky($action)
196 # split v|h|t|vertical|horizontal|toggle
198 direction = 'horizontal', 'vertical', 'toggle', 'v', 'h', 't'
199 -> call cmd_split($direction)
201 # floating enable|disable|toggle
203 floating = 'enable', 'disable', 'toggle'
204 -> call cmd_floating($floating)
206 # mark [--add|--replace] [--toggle] <mark>
208 mode = '--add', '--replace'
213 -> call cmd_mark($mark, $mode, $toggle)
218 -> call cmd_unmark($mark)
220 -> call cmd_unmark($mark)
224 way = 'grow', 'shrink'
229 state RESIZE_DIRECTION:
230 direction = 'up', 'down', 'left', 'right', 'width', 'height'
237 -> call cmd_resize($way, $direction, 10, 10)
245 -> call cmd_resize($way, $direction, &resize_px, 10)
247 state RESIZE_TILING_OR:
249 -> RESIZE_TILING_FINAL
251 state RESIZE_TILING_FINAL:
253 -> call cmd_resize($way, $direction, &resize_px, &resize_ppt)
267 -> call cmd_resize_set(&width, &height)
269 # rename workspace <name> to <name>
270 # rename workspace to <name>
275 state RENAME_WORKSPACE:
277 -> RENAME_WORKSPACE_LIKELY_TO
279 -> RENAME_WORKSPACE_TO
281 state RENAME_WORKSPACE_LIKELY_TO:
283 -> RENAME_WORKSPACE_NEW_NAME
285 -> call cmd_rename_workspace(NULL, $new_name)
287 state RENAME_WORKSPACE_TO:
289 -> RENAME_WORKSPACE_NEW_NAME
291 state RENAME_WORKSPACE_NEW_NAME:
293 -> call cmd_rename_workspace(NULL, "to")
295 -> call cmd_rename_workspace($old_name, $new_name)
297 # move <direction> [<pixels> [px]]
298 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
299 # move [window|container] [to] output <str>
300 # move [window|container] [to] mark <str>
301 # move [window|container] [to] scratchpad
302 # move workspace to [output] <str>
304 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
305 # move [window|container] [to] position mouse|cursor|pointer
313 no_auto_back_and_forth = '--no-auto-back-and-forth'
322 -> call cmd_move_scratchpad()
323 direction = 'left', 'right', 'up', 'down'
328 -> MOVE_TO_ABSOLUTE_POSITION
330 state MOVE_DIRECTION:
334 -> call cmd_move_direction($direction, 10)
336 state MOVE_DIRECTION_PX:
338 -> call cmd_move_direction($direction, &pixels)
340 -> call cmd_move_direction($direction, &pixels)
342 state MOVE_WORKSPACE:
344 -> MOVE_WORKSPACE_TO_OUTPUT
345 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
346 -> call cmd_move_con_to_workspace($workspace)
348 -> call cmd_move_con_to_workspace_back_and_forth()
350 -> MOVE_WORKSPACE_NUMBER
352 -> call cmd_move_con_to_workspace_name($workspace, $no_auto_back_and_forth)
354 state MOVE_WORKSPACE_NUMBER:
356 -> call cmd_move_con_to_workspace_number($number, $no_auto_back_and_forth)
358 state MOVE_TO_OUTPUT:
360 -> call cmd_move_con_to_output($output)
364 -> call cmd_move_con_to_mark($mark)
366 state MOVE_WORKSPACE_TO_OUTPUT:
370 -> call cmd_move_workspace_to_output($output)
372 state MOVE_TO_ABSOLUTE_POSITION:
376 state MOVE_TO_POSITION:
378 -> call cmd_move_window_to_center($method)
379 'mouse', 'cursor', 'pointer'
380 -> call cmd_move_window_to_mouse()
382 -> MOVE_TO_POSITION_X
384 state MOVE_TO_POSITION_X:
388 -> MOVE_TO_POSITION_Y
390 state MOVE_TO_POSITION_Y:
392 -> call cmd_move_window_to_position($method, &coord_x, &coord_y)
397 -> call cmd_mode($mode)
401 -> call cmd_nop($comment)
403 -> call cmd_nop(NULL)
407 -> call cmd_scratchpad_show()
411 -> call cmd_title_format($format)
413 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
415 bar_type = 'hidden_state'
420 state BAR_HIDDEN_STATE:
421 bar_value = 'hide', 'show', 'toggle'
425 bar_value = 'dock', 'hide', 'invisible', 'toggle'
432 -> call cmd_bar($bar_type, $bar_value, $bar_id)