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
44 ctype = 'class' -> CRITERION
45 ctype = 'instance' -> CRITERION
46 ctype = 'window_role' -> CRITERION
47 ctype = 'con_id' -> CRITERION
48 ctype = 'id' -> CRITERION
49 ctype = 'window_type' -> CRITERION
50 ctype = 'con_mark' -> CRITERION
51 ctype = 'title' -> CRITERION
52 ctype = 'urgent' -> CRITERION
53 ']' -> call cmd_criteria_match_windows(); INITIAL
60 -> call cmd_criteria_add($ctype, $cvalue); CRITERIA
62 # exec [--no-startup-id] <command>
64 nosn = '--no-startup-id'
67 -> call cmd_exec($nosn, $command)
69 # shmlog <size>|toggle|on|off
71 # argument may be a number
73 -> call cmd_shmlog($argument)
75 # debuglog toggle|on|off
77 argument = 'toggle', 'on', 'off'
78 -> call cmd_debuglog($argument)
80 # border normal|none|1pixel|toggle|1pixel
82 border_style = 'normal', 'pixel'
84 border_style = 'none', 'toggle'
85 -> call cmd_border($border_style, "0")
86 border_style = '1pixel'
87 -> call cmd_border($border_style, "1")
91 -> call cmd_border($border_style, "2")
93 -> call cmd_border($border_style, $border_width)
95 # layout default|stacked|stacking|tabbed|splitv|splith
96 # layout toggle [split|all]
98 layout_mode = 'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith'
99 -> call cmd_layout($layout_mode)
103 # layout toggle [split|all]
106 -> call cmd_layout_toggle($toggle_mode)
107 toggle_mode = 'split', 'all'
108 -> call cmd_layout_toggle($toggle_mode)
110 # append_layout <path>
112 path = string -> call cmd_append_layout($path)
114 # workspace next|prev|next_on_output|prev_on_output
115 # workspace back_and_forth
117 # workspace number <number>
119 direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
120 -> call cmd_workspace($direction)
122 -> call cmd_workspace_back_and_forth()
126 -> call cmd_workspace_name($workspace)
128 state WORKSPACE_NUMBER:
130 -> call cmd_workspace_number($workspace)
132 # focus left|right|up|down
133 # focus output <output>
134 # focus tiling|floating|mode_toggle
138 direction = 'left', 'right', 'up', 'down'
139 -> call cmd_focus_direction($direction)
142 window_mode = 'tiling', 'floating', 'mode_toggle'
143 -> call cmd_focus_window_mode($window_mode)
144 level = 'parent', 'child'
145 -> call cmd_focus_level($level)
151 -> call cmd_focus_output($output)
153 # kill [window|client]
155 kill_mode = 'window', 'client'
156 -> call cmd_kill($kill_mode)
158 -> call cmd_kill($kill_mode)
160 # fullscreen enable|toggle [global]
162 # fullscreen [global]
165 -> call cmd_fullscreen($action, "output")
166 action = 'enable', 'toggle'
171 state FULLSCREEN_MODE:
173 -> call cmd_fullscreen($action, $mode)
175 -> call cmd_fullscreen($action, "output")
177 state FULLSCREEN_COMPAT:
179 -> call cmd_fullscreen("toggle", $mode)
181 -> call cmd_fullscreen("toggle", "output")
183 # split v|h|vertical|horizontal
185 direction = 'horizontal', 'vertical', 'v', 'h'
186 -> call cmd_split($direction)
188 # floating enable|disable|toggle
190 floating = 'enable', 'disable', 'toggle'
191 -> call cmd_floating($floating)
193 # mark [--toggle] <mark>
198 -> call cmd_mark($mark, $toggle)
203 -> call cmd_unmark($mark)
205 -> call cmd_unmark($mark)
209 way = 'grow', 'shrink'
212 state RESIZE_DIRECTION:
213 direction = 'up', 'down', 'left', 'right', 'width', 'height'
220 -> call cmd_resize($way, $direction, "10", "10")
228 -> call cmd_resize($way, $direction, $resize_px, "10")
230 state RESIZE_TILING_OR:
232 -> RESIZE_TILING_FINAL
234 state RESIZE_TILING_FINAL:
236 -> call cmd_resize($way, $direction, $resize_px, $resize_ppt)
238 # rename workspace <name> to <name>
239 # rename workspace to <name>
244 state RENAME_WORKSPACE:
246 -> RENAME_WORKSPACE_LIKELY_TO
248 -> RENAME_WORKSPACE_TO
250 state RENAME_WORKSPACE_LIKELY_TO:
252 -> RENAME_WORKSPACE_NEW_NAME
254 -> call cmd_rename_workspace(NULL, $new_name)
256 state RENAME_WORKSPACE_TO:
258 -> RENAME_WORKSPACE_NEW_NAME
260 state RENAME_WORKSPACE_NEW_NAME:
262 -> call cmd_rename_workspace(NULL, "to")
264 -> call cmd_rename_workspace($old_name, $new_name)
266 # move <direction> [<pixels> [px]]
267 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
268 # move [window|container] [to] output <str>
269 # move [window|container] [to] mark <str>
270 # move [window|container] [to] scratchpad
271 # move workspace to [output] <str>
273 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
288 -> call cmd_move_scratchpad()
289 direction = 'left', 'right', 'up', 'down'
294 -> MOVE_TO_ABSOLUTE_POSITION
296 state MOVE_DIRECTION:
300 -> call cmd_move_direction($direction, "10")
302 state MOVE_DIRECTION_PX:
304 -> call cmd_move_direction($direction, $pixels)
306 -> call cmd_move_direction($direction, $pixels)
308 state MOVE_WORKSPACE:
310 -> MOVE_WORKSPACE_TO_OUTPUT
311 workspace = 'next_on_output', 'prev_on_output', 'next', 'prev', 'current'
312 -> call cmd_move_con_to_workspace($workspace)
314 -> call cmd_move_con_to_workspace_back_and_forth()
316 -> MOVE_WORKSPACE_NUMBER
318 -> call cmd_move_con_to_workspace_name($workspace)
320 state MOVE_WORKSPACE_NUMBER:
322 -> call cmd_move_con_to_workspace_number($number)
324 state MOVE_TO_OUTPUT:
326 -> call cmd_move_con_to_output($output)
330 -> call cmd_move_con_to_mark($mark)
332 state MOVE_WORKSPACE_TO_OUTPUT:
336 -> call cmd_move_workspace_to_output($output)
338 state MOVE_TO_ABSOLUTE_POSITION:
342 state MOVE_TO_POSITION:
344 -> call cmd_move_window_to_center($method)
346 -> MOVE_TO_POSITION_X
348 state MOVE_TO_POSITION_X:
352 -> MOVE_TO_POSITION_Y
354 state MOVE_TO_POSITION_Y:
356 -> call cmd_move_window_to_position($method, $coord_x, $coord_y)
361 -> call cmd_mode($mode)
365 -> call cmd_nop($comment)
367 -> call cmd_nop(NULL)
371 -> call cmd_scratchpad_show()
373 # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
375 bar_type = 'hidden_state'
380 state BAR_HIDDEN_STATE:
381 bar_value = 'hide', 'show', 'toggle'
385 bar_value = 'dock', 'hide', 'invisible', 'toggle'
392 -> call cmd_bar($bar_type, $bar_value, $bar_id)