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
33 'floating' -> FLOATING
39 'scratchpad' -> SCRATCHPAD
40 'title_format' -> TITLE_FORMAT
45 ctype = 'class' -> CRITERION
46 ctype = 'instance' -> CRITERION
47 ctype = 'window_role' -> CRITERION
48 ctype = 'con_id' -> CRITERION
49 ctype = 'id' -> CRITERION
50 ctype = 'window_type' -> CRITERION
51 ctype = 'con_mark' -> CRITERION
52 ctype = 'title' -> CRITERION
53 ctype = 'urgent' -> CRITERION
54 ctype = 'workspace' -> CRITERION
55 ']' -> call cmd_criteria_match_windows(); INITIAL
62 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
64 # exec [--no-startup-id] <command>
66 nosn = '--no-startup-id'
69 -> call cmd_exec($nosn, $command)
71 # shmlog <size>|toggle|on|off
73 # argument may be a number
75 -> call cmd_shmlog($argument)
77 # debuglog toggle|on|off
79 argument = 'toggle', 'on', 'off'
80 -> call cmd_debuglog($argument)
82 # border normal|pixel [<n>]
83 # border none|1pixel|toggle
85 border_style = 'normal', 'pixel'
87 border_style = 'none', 'toggle'
88 -> call cmd_border($border_style, "0")
89 border_style = '1pixel'
90 -> call cmd_border($border_style, "1")
94 -> call cmd_border($border_style, "2")
96 -> call cmd_border($border_style, $border_width)
98 # layout default|stacked|stacking|tabbed|splitv|splith
99 # layout toggle [split|all]
101 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
102 -> call cmd_layout($layout_mode)
106 # layout toggle [split|all]
109 -> call cmd_layout_toggle($toggle_mode)
110 toggle_mode = 'split', 'all'
111 -> call cmd_layout_toggle($toggle_mode)
113 # append_layout <path>
115 path = string -> call cmd_append_layout($path)
117 # workspace next|prev|next_on_output|prev_on_output
118 # workspace back_and_forth
120 # workspace number <number>
122 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
123 -> call cmd_workspace($direction)
125 -> call cmd_workspace_back_and_forth()
129 -> call cmd_workspace_name($workspace)
131 state WORKSPACE_NUMBER:
133 -> call cmd_workspace_number($workspace)
135 # focus left|right|up|down
136 # focus output <output>
137 # focus tiling|floating|mode_toggle
141 direction = 'left', 'right', 'up', 'down'
142 -> call cmd_focus_direction($direction)
145 window_mode = 'tiling', 'floating', 'mode_toggle'
146 -> call cmd_focus_window_mode($window_mode)
147 level = 'parent', 'child'
148 -> call cmd_focus_level($level)
154 -> call cmd_focus_output($output)
156 # kill [window|client]
158 kill_mode = 'window', 'client'
159 -> call cmd_kill($kill_mode)
161 -> call cmd_kill($kill_mode)
163 # fullscreen enable|toggle [global]
165 # fullscreen [global]
168 -> call cmd_fullscreen($action, "output")
169 action = 'enable', 'toggle'
174 state FULLSCREEN_MODE:
176 -> call cmd_fullscreen($action, $mode)
178 -> call cmd_fullscreen($action, "output")
180 state FULLSCREEN_COMPAT:
182 -> call cmd_fullscreen("toggle", $mode)
184 -> call cmd_fullscreen("toggle", "output")
186 # split v|h|vertical|horizontal
188 direction = 'horizontal', 'vertical', 'v', 'h'
189 -> call cmd_split($direction)
191 # floating enable|disable|toggle
193 floating = 'enable', 'disable', 'toggle'
194 -> call cmd_floating($floating)
196 # mark [--toggle] <mark>
201 -> call cmd_mark($mark, $toggle)
206 -> call cmd_unmark($mark)
208 -> call cmd_unmark($mark)
212 way = 'grow', 'shrink'
215 state RESIZE_DIRECTION:
216 direction = 'up', 'down', 'left', 'right', 'width', 'height'
223 -> call cmd_resize($way, $direction, "10", "10")
231 -> call cmd_resize($way, $direction, $resize_px, "10")
233 state RESIZE_TILING_OR:
235 -> RESIZE_TILING_FINAL
237 state RESIZE_TILING_FINAL:
239 -> call cmd_resize($way, $direction, $resize_px, $resize_ppt)
241 # rename workspace <name> to <name>
242 # rename workspace to <name>
247 state RENAME_WORKSPACE:
249 -> RENAME_WORKSPACE_LIKELY_TO
251 -> RENAME_WORKSPACE_TO
253 state RENAME_WORKSPACE_LIKELY_TO:
255 -> RENAME_WORKSPACE_NEW_NAME
257 -> call cmd_rename_workspace(NULL, $new_name)
259 state RENAME_WORKSPACE_TO:
261 -> RENAME_WORKSPACE_NEW_NAME
263 state RENAME_WORKSPACE_NEW_NAME:
265 -> call cmd_rename_workspace(NULL, "to")
267 -> call cmd_rename_workspace($old_name, $new_name)
269 # move <direction> [<pixels> [px]]
270 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
271 # move [window|container] [to] output <str>
272 # move [window|container] [to] mark <str>
273 # move [window|container] [to] scratchpad
274 # move workspace to [output] <str>
276 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
277 # move [window|container] [to] position mouse|cursor|pointer
292 -> call cmd_move_scratchpad()
293 direction = 'left', 'right', 'up', 'down'
298 -> MOVE_TO_ABSOLUTE_POSITION
300 state MOVE_DIRECTION:
304 -> call cmd_move_direction($direction, "10")
306 state MOVE_DIRECTION_PX:
308 -> call cmd_move_direction($direction, $pixels)
310 -> call cmd_move_direction($direction, $pixels)
312 state MOVE_WORKSPACE:
314 -> MOVE_WORKSPACE_TO_OUTPUT
315 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
316 -> call cmd_move_con_to_workspace($workspace)
318 -> call cmd_move_con_to_workspace_back_and_forth()
320 -> MOVE_WORKSPACE_NUMBER
322 -> call cmd_move_con_to_workspace_name($workspace)
324 state MOVE_WORKSPACE_NUMBER:
326 -> call cmd_move_con_to_workspace_number($number)
328 state MOVE_TO_OUTPUT:
330 -> call cmd_move_con_to_output($output)
334 -> call cmd_move_con_to_mark($mark)
336 state MOVE_WORKSPACE_TO_OUTPUT:
340 -> call cmd_move_workspace_to_output($output)
342 state MOVE_TO_ABSOLUTE_POSITION:
346 state MOVE_TO_POSITION:
348 -> call cmd_move_window_to_center($method)
349 'mouse', 'cursor', 'pointer'
350 -> call cmd_move_window_to_mouse()
352 -> MOVE_TO_POSITION_X
354 state MOVE_TO_POSITION_X:
358 -> MOVE_TO_POSITION_Y
360 state MOVE_TO_POSITION_Y:
362 -> call cmd_move_window_to_position($method, $coord_x, $coord_y)
367 -> call cmd_mode($mode)
371 -> call cmd_nop($comment)
373 -> call cmd_nop(NULL)
377 -> call cmd_scratchpad_show()
381 -> call cmd_title_format($format)
383 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
385 bar_type = 'hidden_state'
390 state BAR_HIDDEN_STATE:
391 bar_value = 'hide', 'show', 'toggle'
395 bar_value = 'dock', 'hide', 'invisible', 'toggle'
402 -> call cmd_bar($bar_type, $bar_value, $bar_id)