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
121 # workspace number <number>
123 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
124 -> call cmd_workspace($direction)
126 -> call cmd_workspace_back_and_forth()
130 -> call cmd_workspace_name($workspace)
132 state WORKSPACE_NUMBER:
134 -> call cmd_workspace_number($workspace)
136 # focus left|right|up|down
137 # focus output <output>
138 # focus tiling|floating|mode_toggle
142 direction = 'left', 'right', 'up', 'down'
143 -> call cmd_focus_direction($direction)
146 window_mode = 'tiling', 'floating', 'mode_toggle'
147 -> call cmd_focus_window_mode($window_mode)
148 level = 'parent', 'child'
149 -> call cmd_focus_level($level)
155 -> call cmd_focus_output($output)
157 # kill [window|client]
159 kill_mode = 'window', 'client'
160 -> call cmd_kill($kill_mode)
162 -> call cmd_kill($kill_mode)
164 # fullscreen enable|toggle [global]
166 # fullscreen [global]
169 -> call cmd_fullscreen($action, "output")
170 action = 'enable', 'toggle'
175 state FULLSCREEN_MODE:
177 -> call cmd_fullscreen($action, $mode)
179 -> call cmd_fullscreen($action, "output")
181 state FULLSCREEN_COMPAT:
183 -> call cmd_fullscreen("toggle", $mode)
185 -> call cmd_fullscreen("toggle", "output")
187 # sticky enable|disable|toggle
189 action = 'enable', 'disable', 'toggle'
190 -> call cmd_sticky($action)
192 # split v|h|vertical|horizontal
194 direction = 'horizontal', 'vertical', 'v', 'h'
195 -> call cmd_split($direction)
197 # floating enable|disable|toggle
199 floating = 'enable', 'disable', 'toggle'
200 -> call cmd_floating($floating)
202 # mark [--toggle] <mark>
207 -> call cmd_mark($mark, $toggle)
212 -> call cmd_unmark($mark)
214 -> call cmd_unmark($mark)
218 way = 'grow', 'shrink'
223 state RESIZE_DIRECTION:
224 direction = 'up', 'down', 'left', 'right', 'width', 'height'
231 -> call cmd_resize($way, $direction, 10, 10)
239 -> call cmd_resize($way, $direction, &resize_px, 10)
241 state RESIZE_TILING_OR:
243 -> RESIZE_TILING_FINAL
245 state RESIZE_TILING_FINAL:
247 -> call cmd_resize($way, $direction, &resize_px, &resize_ppt)
261 -> call cmd_resize_set(&width, &height)
263 # rename workspace <name> to <name>
264 # rename workspace to <name>
269 state RENAME_WORKSPACE:
271 -> RENAME_WORKSPACE_LIKELY_TO
273 -> RENAME_WORKSPACE_TO
275 state RENAME_WORKSPACE_LIKELY_TO:
277 -> RENAME_WORKSPACE_NEW_NAME
279 -> call cmd_rename_workspace(NULL, $new_name)
281 state RENAME_WORKSPACE_TO:
283 -> RENAME_WORKSPACE_NEW_NAME
285 state RENAME_WORKSPACE_NEW_NAME:
287 -> call cmd_rename_workspace(NULL, "to")
289 -> call cmd_rename_workspace($old_name, $new_name)
291 # move <direction> [<pixels> [px]]
292 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
293 # move [window|container] [to] output <str>
294 # move [window|container] [to] mark <str>
295 # move [window|container] [to] scratchpad
296 # move workspace to [output] <str>
298 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
299 # move [window|container] [to] position mouse|cursor|pointer
314 -> call cmd_move_scratchpad()
315 direction = 'left', 'right', 'up', 'down'
320 -> MOVE_TO_ABSOLUTE_POSITION
322 state MOVE_DIRECTION:
326 -> call cmd_move_direction($direction, 10)
328 state MOVE_DIRECTION_PX:
330 -> call cmd_move_direction($direction, &pixels)
332 -> call cmd_move_direction($direction, &pixels)
334 state MOVE_WORKSPACE:
336 -> MOVE_WORKSPACE_TO_OUTPUT
337 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
338 -> call cmd_move_con_to_workspace($workspace)
340 -> call cmd_move_con_to_workspace_back_and_forth()
342 -> MOVE_WORKSPACE_NUMBER
344 -> call cmd_move_con_to_workspace_name($workspace)
346 state MOVE_WORKSPACE_NUMBER:
348 -> call cmd_move_con_to_workspace_number($number)
350 state MOVE_TO_OUTPUT:
352 -> call cmd_move_con_to_output($output)
356 -> call cmd_move_con_to_mark($mark)
358 state MOVE_WORKSPACE_TO_OUTPUT:
362 -> call cmd_move_workspace_to_output($output)
364 state MOVE_TO_ABSOLUTE_POSITION:
368 state MOVE_TO_POSITION:
370 -> call cmd_move_window_to_center($method)
371 'mouse', 'cursor', 'pointer'
372 -> call cmd_move_window_to_mouse()
374 -> MOVE_TO_POSITION_X
376 state MOVE_TO_POSITION_X:
380 -> MOVE_TO_POSITION_Y
382 state MOVE_TO_POSITION_Y:
384 -> call cmd_move_window_to_position($method, &coord_x, &coord_y)
389 -> call cmd_mode($mode)
393 -> call cmd_nop($comment)
395 -> call cmd_nop(NULL)
399 -> call cmd_scratchpad_show()
403 -> call cmd_title_format($format)
405 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
407 bar_type = 'hidden_state'
412 state BAR_HIDDEN_STATE:
413 bar_value = 'hide', 'show', 'toggle'
417 bar_value = 'dock', 'hide', 'invisible', 'toggle'
424 -> call cmd_bar($bar_type, $bar_value, $bar_id)