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()
23 'debuglog' -> DEBUGLOG
26 'append_layout' -> APPEND_LAYOUT
27 'workspace' -> WORKSPACE
30 'open' -> call cmd_open()
31 'fullscreen' -> FULLSCREEN
33 'floating' -> FLOATING
39 'scratchpad' -> SCRATCHPAD
44 ctype = 'class' -> CRITERION
45 ctype = 'instance' -> CRITERION
46 ctype = 'window_role' -> CRITERION
47 ctype = 'con_id' -> CRITERION
48 ctype = 'id' -> CRITERION
49 ctype = 'con_mark' -> CRITERION
50 ctype = 'title' -> CRITERION
51 ctype = 'urgent' -> CRITERION
52 ']' -> call cmd_criteria_match_windows(); INITIAL
59 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
61 # exec [--no-startup-id] <command>
63 nosn = '--no-startup-id'
66 -> call cmd_exec($nosn, $command)
68 # shmlog <size>|toggle|on|off
70 # argument may be a number
72 -> call cmd_shmlog($argument)
74 # debuglog toggle|on|off
76 argument = 'toggle', 'on', 'off'
77 -> call cmd_debuglog($argument)
79 # border normal|none|1pixel|toggle|1pixel
81 border_style = 'normal', 'pixel'
83 border_style = 'none', 'toggle'
84 -> call cmd_border($border_style, "0")
85 border_style = '1pixel'
86 -> call cmd_border($border_style, "1")
90 -> call cmd_border($border_style, "2")
92 -> call cmd_border($border_style, $border_width)
94 # layout default|stacked|stacking|tabbed|splitv|splith
95 # layout toggle [split|all]
97 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
98 -> call cmd_layout($layout_mode)
102 # layout toggle [split|all]
105 -> call cmd_layout_toggle($toggle_mode)
106 toggle_mode = 'split', 'all'
107 -> call cmd_layout_toggle($toggle_mode)
109 # append_layout <path>
111 path = string -> call cmd_append_layout($path)
113 # workspace next|prev|next_on_output|prev_on_output
114 # workspace back_and_forth
116 # workspace number <number>
118 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
119 -> call cmd_workspace($direction)
121 -> call cmd_workspace_back_and_forth()
125 -> call cmd_workspace_name($workspace)
127 state WORKSPACE_NUMBER:
129 -> call cmd_workspace_number($workspace)
131 # focus left|right|up|down
132 # focus output <output>
133 # focus tiling|floating|mode_toggle
137 direction = 'left', 'right', 'up', 'down'
138 -> call cmd_focus_direction($direction)
141 window_mode = 'tiling', 'floating', 'mode_toggle'
142 -> call cmd_focus_window_mode($window_mode)
143 level = 'parent', 'child'
144 -> call cmd_focus_level($level)
150 -> call cmd_focus_output($output)
152 # kill [window|client]
154 kill_mode = 'window', 'client'
155 -> call cmd_kill($kill_mode)
157 -> call cmd_kill($kill_mode)
159 # fullscreen [global]
161 fullscreen_mode = 'global'
162 -> call cmd_fullscreen($fullscreen_mode)
164 -> call cmd_fullscreen($fullscreen_mode)
166 # split v|h|vertical|horizontal
168 direction = 'horizontal', 'vertical', 'v', 'h'
169 -> call cmd_split($direction)
171 # floating enable|disable|toggle
173 floating = 'enable', 'disable', 'toggle'
174 -> call cmd_floating($floating)
179 -> call cmd_mark($mark)
184 -> call cmd_unmark($mark)
186 -> call cmd_unmark($mark)
190 way = 'grow', 'shrink'
193 state RESIZE_DIRECTION:
194 direction = 'up', 'down', 'left', 'right', 'width', 'height'
201 -> call cmd_resize($way, $direction, "10", "10")
209 -> call cmd_resize($way, $direction, $resize_px, "10")
211 state RESIZE_TILING_OR:
213 -> RESIZE_TILING_FINAL
215 state RESIZE_TILING_FINAL:
217 -> call cmd_resize($way, $direction, $resize_px, $resize_ppt)
219 # rename workspace <name> to <name>
220 # rename workspace to <name>
225 state RENAME_WORKSPACE:
227 -> RENAME_WORKSPACE_LIKELY_TO
229 -> RENAME_WORKSPACE_TO
231 state RENAME_WORKSPACE_LIKELY_TO:
233 -> RENAME_WORKSPACE_NEW_NAME
235 -> call cmd_rename_workspace(NULL, $new_name)
237 state RENAME_WORKSPACE_TO:
239 -> RENAME_WORKSPACE_NEW_NAME
241 state RENAME_WORKSPACE_NEW_NAME:
243 -> call cmd_rename_workspace(NULL, "to")
245 -> call cmd_rename_workspace($old_name, $new_name)
247 # move <direction> [<pixels> [px]]
248 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
249 # move [window|container] [to] output <str>
250 # move [window|container] [to] scratchpad
251 # move workspace to [output] <str>
253 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
266 -> call cmd_move_scratchpad()
267 direction = 'left', 'right', 'up', 'down'
272 -> MOVE_TO_ABSOLUTE_POSITION
274 state MOVE_DIRECTION:
278 -> call cmd_move_direction($direction, "10")
280 state MOVE_DIRECTION_PX:
282 -> call cmd_move_direction($direction, $pixels)
284 -> call cmd_move_direction($direction, $pixels)
286 state MOVE_WORKSPACE:
288 -> MOVE_WORKSPACE_TO_OUTPUT
289 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
290 -> call cmd_move_con_to_workspace($workspace)
292 -> call cmd_move_con_to_workspace_back_and_forth()
294 -> MOVE_WORKSPACE_NUMBER
296 -> call cmd_move_con_to_workspace_name($workspace)
298 state MOVE_WORKSPACE_NUMBER:
300 -> call cmd_move_con_to_workspace_number($number)
302 state MOVE_TO_OUTPUT:
304 -> call cmd_move_con_to_output($output)
306 state MOVE_WORKSPACE_TO_OUTPUT:
310 -> call cmd_move_workspace_to_output($output)
312 state MOVE_TO_ABSOLUTE_POSITION:
316 state MOVE_TO_POSITION:
318 -> call cmd_move_window_to_center($method)
320 -> MOVE_TO_POSITION_X
322 state MOVE_TO_POSITION_X:
326 -> MOVE_TO_POSITION_Y
328 state MOVE_TO_POSITION_Y:
330 -> call cmd_move_window_to_position($method, $coord_x, $coord_y)
335 -> call cmd_mode($mode)
339 -> call cmd_nop($comment)
343 -> call cmd_scratchpad_show()
345 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
347 bar_type = 'hidden_state'
352 state BAR_HIDDEN_STATE:
353 bar_value = 'hide', 'show', 'toggle'
357 bar_value = 'dock', 'hide', 'invisible', 'toggle'
364 -> call cmd_bar($bar_type, $bar_value, $bar_id)