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/config.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
12 # TODO: should we implement an include statement for the criteria part so we DRY?
15 # We have an end token here for all the commands which just call some
16 # function without using an explicit 'end' token.
21 bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
25 'floating_minimum_size' -> FLOATING_MINIMUM_SIZE_WIDTH
26 'floating_maximum_size' -> FLOATING_MAXIMUM_SIZE_WIDTH
27 'floating_modifier' -> FLOATING_MODIFIER
28 'default_orientation' -> DEFAULT_ORIENTATION
29 'workspace_layout' -> WORKSPACE_LAYOUT
30 windowtype = 'new_window', 'new_float' -> NEW_WINDOW
31 'hide_edge_borders' -> HIDE_EDGE_BORDERS
32 'for_window' -> FOR_WINDOW
34 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
35 'mouse_warping' -> MOUSE_WARPING
36 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
37 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
38 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
39 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
40 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
41 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
42 'workspace' -> WORKSPACE
43 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
44 'restart_state' -> RESTART_STATE
45 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
46 exectype = 'exec_always', 'exec' -> EXEC
47 colorclass = 'client.background'
49 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
52 # We ignore comments and 'set' lines (variables).
57 # floating_minimum_size <width> x <height>
58 state FLOATING_MINIMUM_SIZE_WIDTH:
60 -> FLOATING_MINIMUM_SIZE_X
62 state FLOATING_MINIMUM_SIZE_X:
64 -> FLOATING_MINIMUM_SIZE_HEIGHT
66 state FLOATING_MINIMUM_SIZE_HEIGHT:
68 -> call cfg_floating_minimum_size(&width, &height)
70 # floating_maximum_size <width> x <height>
71 state FLOATING_MAXIMUM_SIZE_WIDTH:
73 -> FLOATING_MAXIMUM_SIZE_X
75 state FLOATING_MAXIMUM_SIZE_X:
77 -> FLOATING_MAXIMUM_SIZE_HEIGHT
79 state FLOATING_MAXIMUM_SIZE_HEIGHT:
81 -> call cfg_floating_maximum_size(&width, &height)
83 # floating_modifier <modifier>
84 state FLOATING_MODIFIER:
85 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
90 -> call cfg_floating_modifier($modifiers)
92 # default_orientation <horizontal|vertical|auto>
93 state DEFAULT_ORIENTATION:
94 orientation = 'horizontal', 'vertical', 'auto'
95 -> call cfg_default_orientation($orientation)
97 # workspace_layout <default|stacking|tabbed>
98 state WORKSPACE_LAYOUT:
99 layout = 'default', 'stacking', 'stacked', 'tabbed'
100 -> call cfg_workspace_layout($layout)
102 # new_window <normal|1pixel|none>
103 # new_float <normal|1pixel|none>
104 # TODO: new_float is not in the userguide yet
105 # TODO: pixel is not in the userguide yet
107 border = 'normal', 'pixel'
109 border = '1pixel', 'none'
110 -> call cfg_new_window($windowtype, $border, -1)
112 state NEW_WINDOW_PIXELS:
114 -> call cfg_new_window($windowtype, $border, 2)
116 -> NEW_WINDOW_PIXELS_PX
118 state NEW_WINDOW_PIXELS_PX:
122 -> call cfg_new_window($windowtype, $border, &width)
124 # hide_edge_borders <none|vertical|horizontal|both>
125 # also hide_edge_borders <bool> for compatibility
126 state HIDE_EDGE_BORDERS:
127 hide_borders = 'none', 'vertical', 'horizontal', 'both'
128 -> call cfg_hide_edge_borders($hide_borders)
129 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
130 -> call cfg_hide_edge_borders($hide_borders)
132 # for_window <criteria> command
135 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
137 state FOR_WINDOW_COMMAND:
139 -> call cfg_for_window($command)
141 # assign <criteria> [→] workspace
144 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
146 state ASSIGN_WORKSPACE:
150 -> call cfg_assign($workspace)
152 # Criteria: Used by for_window and assign.
154 ctype = 'class' -> CRITERION
155 ctype = 'instance' -> CRITERION
156 ctype = 'window_role' -> CRITERION
157 ctype = 'con_id' -> CRITERION
158 ctype = 'id' -> CRITERION
159 ctype = 'con_mark' -> CRITERION
160 ctype = 'title' -> CRITERION
161 ctype = 'urgent' -> CRITERION
163 -> call cfg_criteria_pop_state()
170 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
172 # focus_follows_mouse bool
173 state FOCUS_FOLLOWS_MOUSE:
175 -> call cfg_focus_follows_mouse($value)
177 # mouse_warping warping_t
179 value = 'none', 'output'
180 -> call cfg_mouse_warping($value)
182 # force_focus_wrapping
183 state FORCE_FOCUS_WRAPPING:
185 -> call cfg_force_focus_wrapping($value)
188 state FORCE_XINERAMA:
190 -> call cfg_force_xinerama($value)
192 # workspace_back_and_forth
193 state WORKSPACE_BACK_AND_FORTH:
195 -> call cfg_workspace_back_and_forth($value)
198 # fake_outputs (for testcases)
201 -> call cfg_fake_outputs($outputs)
203 # force_display_urgency_hint <timeout> ms
204 state FORCE_DISPLAY_URGENCY_HINT:
206 -> FORCE_DISPLAY_URGENCY_HINT_MS
208 state FORCE_DISPLAY_URGENCY_HINT_MS:
212 -> call cfg_force_display_urgency_hint(&duration_ms)
214 # focus_on_window_activation <smart|urgent|focus|none>
215 state FOCUS_ON_WINDOW_ACTIVATION:
217 -> call cfg_focus_on_window_activation($mode)
219 # workspace <workspace> output <output>
224 state WORKSPACE_OUTPUT:
226 -> WORKSPACE_OUTPUT_STR
228 state WORKSPACE_OUTPUT_STR:
230 -> call cfg_workspace($workspace, $output)
235 -> call cfg_ipc_socket($path)
237 # restart_state <path> (for testcases)
240 -> call cfg_restart_state($path)
242 # popup_during_fullscreen
243 state POPUP_DURING_FULLSCREEN:
244 value = 'ignore', 'leave_fullscreen', 'smart'
245 -> call cfg_popup_during_fullscreen($value)
247 # client.background <hexcolor>
250 -> call cfg_color_single($colorclass, $color)
252 # colorclass border background text indicator
257 state COLOR_BACKGROUND:
265 state COLOR_INDICATOR:
267 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
269 -> call cfg_color($colorclass, $border, $background, $text, NULL)
271 # <exec|exec_always> [--no-startup-id] command
273 no_startup_id = '--no-startup-id'
276 -> call cfg_exec($exectype, $no_startup_id, $command)
281 -> call cfg_font($font)
285 release = '--release'
287 whole_window = '--whole-window'
289 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
297 release = '--release'
299 whole_window = '--whole-window'
302 -> call cfg_binding($bindtype, $modifiers, $key, $release, $whole_window, $command)
304 ################################################################################
306 ################################################################################
310 -> call cfg_enter_mode($modename); MODEBRACE
321 '#' -> MODE_IGNORE_LINE
322 'set' -> MODE_IGNORE_LINE
323 bindtype = 'bindsym', 'bindcode', 'bind'
328 # We ignore comments and 'set' lines (variables).
329 state MODE_IGNORE_LINE:
334 release = '--release'
336 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
343 state MODE_BINDCOMMAND:
344 release = '--release'
346 whole_window = '--whole-window'
349 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $whole_window, $command); MODE
351 ################################################################################
352 # Bar configuration (i3bar)
353 ################################################################################
364 '#' -> BAR_IGNORE_LINE
365 'set' -> BAR_IGNORE_LINE
366 'i3bar_command' -> BAR_BAR_COMMAND
367 'status_command' -> BAR_STATUS_COMMAND
368 'socket_path' -> BAR_SOCKET_PATH
370 'hidden_state' -> BAR_HIDDEN_STATE
372 'modifier' -> BAR_MODIFIER
373 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
374 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
375 'position' -> BAR_POSITION
376 'output' -> BAR_OUTPUT
377 'tray_output' -> BAR_TRAY_OUTPUT
379 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
380 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
381 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
382 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
383 'verbose' -> BAR_VERBOSE
384 'colors' -> BAR_COLORS_BRACE
386 -> call cfg_bar_finish(); INITIAL
388 # We ignore comments and 'set' lines (variables).
389 state BAR_IGNORE_LINE:
393 state BAR_BAR_COMMAND:
395 -> call cfg_bar_i3bar_command($command); BAR
397 state BAR_STATUS_COMMAND:
399 -> call cfg_bar_status_command($command); BAR
401 state BAR_SOCKET_PATH:
403 -> call cfg_bar_socket_path($path); BAR
406 mode = 'dock', 'hide', 'invisible'
407 -> call cfg_bar_mode($mode); BAR
409 state BAR_HIDDEN_STATE:
410 hidden_state = 'hide', 'show'
411 -> call cfg_bar_hidden_state($hidden_state); BAR
415 -> call cfg_bar_id($bar_id); BAR
418 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
419 -> call cfg_bar_modifier($modifier); BAR
421 state BAR_WHEEL_UP_CMD:
423 -> call cfg_bar_wheel_up_cmd($command); BAR
425 state BAR_WHEEL_DOWN_CMD:
427 -> call cfg_bar_wheel_down_cmd($command); BAR
430 position = 'top', 'bottom'
431 -> call cfg_bar_position($position); BAR
435 -> call cfg_bar_output($output); BAR
437 state BAR_TRAY_OUTPUT:
439 -> call cfg_bar_tray_output($output); BAR
443 -> call cfg_bar_font($font); BAR
445 state BAR_SEPARATOR_SYMBOL:
447 -> call cfg_bar_separator_symbol($separator); BAR
449 state BAR_BINDING_MODE_INDICATOR:
451 -> call cfg_bar_binding_mode_indicator($value); BAR
453 state BAR_WORKSPACE_BUTTONS:
455 -> call cfg_bar_workspace_buttons($value); BAR
457 state BAR_STRIP_WORKSPACE_NUMBERS:
459 -> call cfg_bar_strip_workspace_numbers($value); BAR
463 -> call cfg_bar_verbose($value); BAR
465 state BAR_COLORS_BRACE:
473 '#' -> BAR_COLORS_IGNORE_LINE
474 'set' -> BAR_COLORS_IGNORE_LINE
475 colorclass = 'background', 'statusline', 'separator'
477 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace'
482 # We ignore comments and 'set' lines (variables).
483 state BAR_COLORS_IGNORE_LINE:
487 state BAR_COLORS_SINGLE:
489 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
491 state BAR_COLORS_BORDER:
493 -> BAR_COLORS_BACKGROUND
495 state BAR_COLORS_BACKGROUND:
499 state BAR_COLORS_TEXT:
501 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
503 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS