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/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.
22 'set_from_resource' -> IGNORE_LINE
23 bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
27 'floating_minimum_size' -> FLOATING_MINIMUM_SIZE_WIDTH
28 'floating_maximum_size' -> FLOATING_MAXIMUM_SIZE_WIDTH
29 'floating_modifier' -> FLOATING_MODIFIER
30 'default_orientation' -> DEFAULT_ORIENTATION
31 'workspace_layout' -> WORKSPACE_LAYOUT
32 windowtype = 'new_window', 'new_float' -> NEW_WINDOW
33 'hide_edge_borders' -> HIDE_EDGE_BORDERS
34 'for_window' -> FOR_WINDOW
36 'no_focus' -> NO_FOCUS
37 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
38 'mouse_warping' -> MOUSE_WARPING
39 'focus_wrapping' -> FOCUS_WRAPPING
40 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
41 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
42 'disable_randr15', 'disable-randr15' -> DISABLE_RANDR15
43 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
44 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
45 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
46 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
47 'show_marks' -> SHOW_MARKS
48 'workspace' -> WORKSPACE
49 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
50 'restart_state' -> RESTART_STATE
51 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
52 exectype = 'exec_always', 'exec' -> EXEC
53 colorclass = 'client.background'
55 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
58 # We ignore comments and 'set' lines (variables).
63 # floating_minimum_size <width> x <height>
64 state FLOATING_MINIMUM_SIZE_WIDTH:
66 -> FLOATING_MINIMUM_SIZE_X
68 state FLOATING_MINIMUM_SIZE_X:
70 -> FLOATING_MINIMUM_SIZE_HEIGHT
72 state FLOATING_MINIMUM_SIZE_HEIGHT:
74 -> call cfg_floating_minimum_size(&width, &height)
76 # floating_maximum_size <width> x <height>
77 state FLOATING_MAXIMUM_SIZE_WIDTH:
79 -> FLOATING_MAXIMUM_SIZE_X
81 state FLOATING_MAXIMUM_SIZE_X:
83 -> FLOATING_MAXIMUM_SIZE_HEIGHT
85 state FLOATING_MAXIMUM_SIZE_HEIGHT:
87 -> call cfg_floating_maximum_size(&width, &height)
89 # floating_modifier <modifier>
90 state FLOATING_MODIFIER:
91 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
96 -> call cfg_floating_modifier($modifiers)
98 # default_orientation <horizontal|vertical|auto>
99 state DEFAULT_ORIENTATION:
100 orientation = 'horizontal', 'vertical', 'auto'
101 -> call cfg_default_orientation($orientation)
103 # workspace_layout <default|stacking|tabbed>
104 state WORKSPACE_LAYOUT:
105 layout = 'default', 'stacking', 'stacked', 'tabbed'
106 -> call cfg_workspace_layout($layout)
108 # new_window <normal|1pixel|none>
109 # new_float <normal|1pixel|none>
111 border = 'normal', 'pixel'
113 border = '1pixel', 'none'
114 -> call cfg_new_window($windowtype, $border, -1)
116 state NEW_WINDOW_PIXELS:
118 -> call cfg_new_window($windowtype, $border, 2)
120 -> NEW_WINDOW_PIXELS_PX
122 state NEW_WINDOW_PIXELS_PX:
126 -> call cfg_new_window($windowtype, $border, &width)
128 # hide_edge_borders <none|vertical|horizontal|both|smart>
129 # also hide_edge_borders <bool> for compatibility
130 state HIDE_EDGE_BORDERS:
131 hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
132 -> call cfg_hide_edge_borders($hide_borders)
133 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
134 -> call cfg_hide_edge_borders($hide_borders)
136 # for_window <criteria> command
139 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
141 state FOR_WINDOW_COMMAND:
143 -> call cfg_for_window($command)
145 # assign <criteria> [→] workspace
148 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
150 state ASSIGN_WORKSPACE:
156 -> ASSIGN_WORKSPACE_NUMBER
158 -> call cfg_assign($workspace, 0)
160 state ASSIGN_WORKSPACE_NUMBER:
162 -> call cfg_assign($number, 1)
164 # no_focus <criteria>
167 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
171 -> call cfg_no_focus()
173 # Criteria: Used by for_window and assign.
175 ctype = 'class' -> CRITERION
176 ctype = 'instance' -> CRITERION
177 ctype = 'window_role' -> CRITERION
178 ctype = 'con_id' -> CRITERION
179 ctype = 'id' -> CRITERION
180 ctype = 'window_type' -> CRITERION
181 ctype = 'con_mark' -> CRITERION
182 ctype = 'title' -> CRITERION
183 ctype = 'urgent' -> CRITERION
184 ctype = 'workspace' -> CRITERION
185 ctype = 'tiling', 'floating'
186 -> call cfg_criteria_add($ctype, NULL); CRITERIA
188 -> call cfg_criteria_pop_state()
195 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
197 # focus_follows_mouse bool
198 state FOCUS_FOLLOWS_MOUSE:
200 -> call cfg_focus_follows_mouse($value)
202 # mouse_warping warping_t
204 value = 'none', 'output'
205 -> call cfg_mouse_warping($value)
208 state FOCUS_WRAPPING:
209 value = '1', 'yes', 'true', 'on', 'enable', 'active', '0', 'no', 'false', 'off', 'disable', 'inactive', 'force'
210 -> call cfg_focus_wrapping($value)
212 # force_focus_wrapping
213 state FORCE_FOCUS_WRAPPING:
215 -> call cfg_force_focus_wrapping($value)
218 state FORCE_XINERAMA:
220 -> call cfg_force_xinerama($value)
223 state DISABLE_RANDR15:
225 -> call cfg_disable_randr15($value)
227 # workspace_back_and_forth
228 state WORKSPACE_BACK_AND_FORTH:
230 -> call cfg_workspace_back_and_forth($value)
233 # fake_outputs (for testcases)
236 -> call cfg_fake_outputs($outputs)
238 # force_display_urgency_hint <timeout> ms
239 state FORCE_DISPLAY_URGENCY_HINT:
241 -> FORCE_DISPLAY_URGENCY_HINT_MS
246 -> call cfg_show_marks($value)
248 state FORCE_DISPLAY_URGENCY_HINT_MS:
252 -> call cfg_force_display_urgency_hint(&duration_ms)
254 # focus_on_window_activation <smart|urgent|focus|none>
255 state FOCUS_ON_WINDOW_ACTIVATION:
257 -> call cfg_focus_on_window_activation($mode)
259 # workspace <workspace> output <output>
264 state WORKSPACE_OUTPUT:
266 -> WORKSPACE_OUTPUT_STR
268 state WORKSPACE_OUTPUT_STR:
270 -> call cfg_workspace($workspace, $output)
275 -> call cfg_ipc_socket($path)
277 # restart_state <path> (for testcases)
280 -> call cfg_restart_state($path)
282 # popup_during_fullscreen
283 state POPUP_DURING_FULLSCREEN:
284 value = 'ignore', 'leave_fullscreen', 'smart'
285 -> call cfg_popup_during_fullscreen($value)
287 # client.background <hexcolor>
290 -> call cfg_color_single($colorclass, $color)
292 # colorclass border background text indicator
297 state COLOR_BACKGROUND:
305 state COLOR_INDICATOR:
307 -> COLOR_CHILD_BORDER
309 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
311 state COLOR_CHILD_BORDER:
313 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
315 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
317 # <exec|exec_always> [--no-startup-id] command
319 no_startup_id = '--no-startup-id'
322 -> call cfg_exec($exectype, $no_startup_id, $command)
327 -> call cfg_font($font)
331 release = '--release'
335 whole_window = '--whole-window'
337 exclude_titlebar = '--exclude-titlebar'
339 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
347 release = '--release'
351 whole_window = '--whole-window'
353 exclude_titlebar = '--exclude-titlebar'
356 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
358 ################################################################################
360 ################################################################################
363 pango_markup = '--pango_markup'
366 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
377 '#' -> MODE_IGNORE_LINE
378 'set' -> MODE_IGNORE_LINE
379 bindtype = 'bindsym', 'bindcode', 'bind'
384 # We ignore comments and 'set' lines (variables).
385 state MODE_IGNORE_LINE:
390 release = '--release'
394 whole_window = '--whole-window'
396 exclude_titlebar = '--exclude-titlebar'
398 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
405 state MODE_BINDCOMMAND:
406 release = '--release'
410 whole_window = '--whole-window'
412 exclude_titlebar = '--exclude-titlebar'
415 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
417 ################################################################################
418 # Bar configuration (i3bar)
419 ################################################################################
425 -> call cfg_bar_start(); BAR
430 '#' -> BAR_IGNORE_LINE
431 'set' -> BAR_IGNORE_LINE
432 'i3bar_command' -> BAR_BAR_COMMAND
433 'status_command' -> BAR_STATUS_COMMAND
434 'socket_path' -> BAR_SOCKET_PATH
436 'hidden_state' -> BAR_HIDDEN_STATE
438 'modifier' -> BAR_MODIFIER
439 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
440 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
441 'bindsym' -> BAR_BINDSYM
442 'position' -> BAR_POSITION
443 'output' -> BAR_OUTPUT
444 'tray_output' -> BAR_TRAY_OUTPUT
445 'tray_padding' -> BAR_TRAY_PADDING
447 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
448 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
449 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
450 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
451 'verbose' -> BAR_VERBOSE
452 'colors' -> BAR_COLORS_BRACE
454 -> call cfg_bar_finish(); INITIAL
456 # We ignore comments and 'set' lines (variables).
457 state BAR_IGNORE_LINE:
461 state BAR_BAR_COMMAND:
463 -> call cfg_bar_i3bar_command($command); BAR
465 state BAR_STATUS_COMMAND:
467 -> call cfg_bar_status_command($command); BAR
469 state BAR_SOCKET_PATH:
471 -> call cfg_bar_socket_path($path); BAR
474 mode = 'dock', 'hide', 'invisible'
475 -> call cfg_bar_mode($mode); BAR
477 state BAR_HIDDEN_STATE:
478 hidden_state = 'hide', 'show'
479 -> call cfg_bar_hidden_state($hidden_state); BAR
483 -> call cfg_bar_id($bar_id); BAR
486 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
487 -> call cfg_bar_modifier($modifier); BAR
489 state BAR_WHEEL_UP_CMD:
491 -> call cfg_bar_wheel_up_cmd($command); BAR
493 state BAR_WHEEL_DOWN_CMD:
495 -> call cfg_bar_wheel_down_cmd($command); BAR
499 -> BAR_BINDSYM_COMMAND
501 state BAR_BINDSYM_COMMAND:
503 -> call cfg_bar_bindsym($button, $command); BAR
506 position = 'top', 'bottom'
507 -> call cfg_bar_position($position); BAR
511 -> call cfg_bar_output($output); BAR
513 state BAR_TRAY_OUTPUT:
515 -> call cfg_bar_tray_output($output); BAR
517 state BAR_TRAY_PADDING:
519 -> BAR_TRAY_PADDING_PX
521 state BAR_TRAY_PADDING_PX:
525 -> call cfg_bar_tray_padding(&padding_px); BAR
529 -> call cfg_bar_font($font); BAR
531 state BAR_SEPARATOR_SYMBOL:
533 -> call cfg_bar_separator_symbol($separator); BAR
535 state BAR_BINDING_MODE_INDICATOR:
537 -> call cfg_bar_binding_mode_indicator($value); BAR
539 state BAR_WORKSPACE_BUTTONS:
541 -> call cfg_bar_workspace_buttons($value); BAR
543 state BAR_STRIP_WORKSPACE_NUMBERS:
545 -> call cfg_bar_strip_workspace_numbers($value); BAR
549 -> call cfg_bar_verbose($value); BAR
551 state BAR_COLORS_BRACE:
559 '#' -> BAR_COLORS_IGNORE_LINE
560 'set' -> BAR_COLORS_IGNORE_LINE
561 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
563 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
568 # We ignore comments and 'set' lines (variables).
569 state BAR_COLORS_IGNORE_LINE:
573 state BAR_COLORS_SINGLE:
575 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
577 state BAR_COLORS_BORDER:
579 -> BAR_COLORS_BACKGROUND
581 state BAR_COLORS_BACKGROUND:
585 state BAR_COLORS_TEXT:
587 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
589 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS