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 = 'default_border', 'new_window', 'default_floating_border', 'new_float'
34 'hide_edge_borders' -> HIDE_EDGE_BORDERS
35 'for_window' -> FOR_WINDOW
37 'no_focus' -> NO_FOCUS
38 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
39 'mouse_warping' -> MOUSE_WARPING
40 'focus_wrapping' -> FOCUS_WRAPPING
41 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
42 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
43 'disable_randr15', 'disable-randr15' -> DISABLE_RANDR15
44 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
45 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
46 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
47 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
48 'show_marks' -> SHOW_MARKS
49 'workspace' -> WORKSPACE
50 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
51 'ipc_kill_timeout' -> IPC_KILL_TIMEOUT
52 'restart_state' -> RESTART_STATE
53 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
54 exectype = 'exec_always', 'exec' -> EXEC
55 colorclass = 'client.background'
57 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
60 # We ignore comments and 'set' lines (variables).
65 # floating_minimum_size <width> x <height>
66 state FLOATING_MINIMUM_SIZE_WIDTH:
68 -> FLOATING_MINIMUM_SIZE_X
70 state FLOATING_MINIMUM_SIZE_X:
72 -> FLOATING_MINIMUM_SIZE_HEIGHT
74 state FLOATING_MINIMUM_SIZE_HEIGHT:
76 -> call cfg_floating_minimum_size(&width, &height)
78 # floating_maximum_size <width> x <height>
79 state FLOATING_MAXIMUM_SIZE_WIDTH:
81 -> FLOATING_MAXIMUM_SIZE_X
83 state FLOATING_MAXIMUM_SIZE_X:
85 -> FLOATING_MAXIMUM_SIZE_HEIGHT
87 state FLOATING_MAXIMUM_SIZE_HEIGHT:
89 -> call cfg_floating_maximum_size(&width, &height)
91 # floating_modifier <modifier>
92 state FLOATING_MODIFIER:
93 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
98 -> call cfg_floating_modifier($modifiers)
100 # default_orientation <horizontal|vertical|auto>
101 state DEFAULT_ORIENTATION:
102 orientation = 'horizontal', 'vertical', 'auto'
103 -> call cfg_default_orientation($orientation)
105 # workspace_layout <default|stacking|tabbed>
106 state WORKSPACE_LAYOUT:
107 layout = 'default', 'stacking', 'stacked', 'tabbed'
108 -> call cfg_workspace_layout($layout)
110 # <default_border|new_window> <normal|1pixel|none>
111 # <default_floating_border|new_float> <normal|1pixel|none>
112 state DEFAULT_BORDER:
113 border = 'normal', 'pixel'
114 -> DEFAULT_BORDER_PIXELS
115 border = '1pixel', 'none'
116 -> call cfg_default_border($windowtype, $border, -1)
118 state DEFAULT_BORDER_PIXELS:
120 -> call cfg_default_border($windowtype, $border, 2)
122 -> DEFAULT_BORDER_PIXELS_PX
124 state DEFAULT_BORDER_PIXELS_PX:
128 -> call cfg_default_border($windowtype, $border, &width)
130 # hide_edge_borders <none|vertical|horizontal|both|smart>
131 # also hide_edge_borders <bool> for compatibility
132 state HIDE_EDGE_BORDERS:
133 hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
134 -> call cfg_hide_edge_borders($hide_borders)
135 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
136 -> call cfg_hide_edge_borders($hide_borders)
138 # for_window <criteria> command
141 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
143 state FOR_WINDOW_COMMAND:
145 -> call cfg_for_window($command)
147 # assign <criteria> [→] [workspace | output] <name>
150 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
152 state ASSIGN_WORKSPACE:
160 -> ASSIGN_WORKSPACE_NUMBER
162 -> call cfg_assign($workspace, 0)
166 -> call cfg_assign_output($output)
168 state ASSIGN_WORKSPACE_NUMBER:
170 -> call cfg_assign($number, 1)
172 # no_focus <criteria>
175 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
179 -> call cfg_no_focus()
181 # Criteria: Used by for_window and assign.
183 ctype = 'class' -> CRITERION
184 ctype = 'instance' -> CRITERION
185 ctype = 'window_role' -> CRITERION
186 ctype = 'con_id' -> CRITERION
187 ctype = 'id' -> CRITERION
188 ctype = 'window_type' -> CRITERION
189 ctype = 'con_mark' -> CRITERION
190 ctype = 'title' -> CRITERION
191 ctype = 'urgent' -> CRITERION
192 ctype = 'workspace' -> CRITERION
193 ctype = 'tiling', 'floating'
194 -> call cfg_criteria_add($ctype, NULL); CRITERIA
196 -> call cfg_criteria_pop_state()
203 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
205 # focus_follows_mouse bool
206 state FOCUS_FOLLOWS_MOUSE:
208 -> call cfg_focus_follows_mouse($value)
210 # mouse_warping warping_t
212 value = 'none', 'output'
213 -> call cfg_mouse_warping($value)
216 state FOCUS_WRAPPING:
217 value = '1', 'yes', 'true', 'on', 'enable', 'active', '0', 'no', 'false', 'off', 'disable', 'inactive', 'force'
218 -> call cfg_focus_wrapping($value)
220 # force_focus_wrapping
221 state FORCE_FOCUS_WRAPPING:
223 -> call cfg_force_focus_wrapping($value)
226 state FORCE_XINERAMA:
228 -> call cfg_force_xinerama($value)
231 state DISABLE_RANDR15:
233 -> call cfg_disable_randr15($value)
235 # workspace_back_and_forth
236 state WORKSPACE_BACK_AND_FORTH:
238 -> call cfg_workspace_back_and_forth($value)
241 # fake_outputs (for testcases)
244 -> call cfg_fake_outputs($outputs)
246 # force_display_urgency_hint <timeout> ms
247 state FORCE_DISPLAY_URGENCY_HINT:
249 -> FORCE_DISPLAY_URGENCY_HINT_MS
254 -> call cfg_show_marks($value)
256 state FORCE_DISPLAY_URGENCY_HINT_MS:
260 -> call cfg_force_display_urgency_hint(&duration_ms)
262 # focus_on_window_activation <smart|urgent|focus|none>
263 state FOCUS_ON_WINDOW_ACTIVATION:
265 -> call cfg_focus_on_window_activation($mode)
267 # workspace <workspace> output <output>
272 state WORKSPACE_OUTPUT:
274 -> WORKSPACE_OUTPUT_STR
276 state WORKSPACE_OUTPUT_STR:
278 -> call cfg_workspace($workspace, $output)
283 -> call cfg_ipc_socket($path)
286 state IPC_KILL_TIMEOUT:
288 -> call cfg_ipc_kill_timeout(&timeout)
290 # restart_state <path> (for testcases)
293 -> call cfg_restart_state($path)
295 # popup_during_fullscreen
296 state POPUP_DURING_FULLSCREEN:
297 value = 'ignore', 'leave_fullscreen', 'smart'
298 -> call cfg_popup_during_fullscreen($value)
300 # client.background <hexcolor>
303 -> call cfg_color_single($colorclass, $color)
305 # colorclass border background text indicator
310 state COLOR_BACKGROUND:
318 state COLOR_INDICATOR:
320 -> COLOR_CHILD_BORDER
322 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
324 state COLOR_CHILD_BORDER:
326 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
328 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
330 # <exec|exec_always> [--no-startup-id] command
332 no_startup_id = '--no-startup-id'
335 -> call cfg_exec($exectype, $no_startup_id, $command)
340 -> call cfg_font($font)
344 release = '--release'
348 whole_window = '--whole-window'
350 exclude_titlebar = '--exclude-titlebar'
352 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
360 release = '--release'
364 whole_window = '--whole-window'
366 exclude_titlebar = '--exclude-titlebar'
369 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
371 ################################################################################
373 ################################################################################
376 pango_markup = '--pango_markup'
379 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
390 '#' -> MODE_IGNORE_LINE
391 'set' -> MODE_IGNORE_LINE
392 bindtype = 'bindsym', 'bindcode', 'bind'
397 # We ignore comments and 'set' lines (variables).
398 state MODE_IGNORE_LINE:
403 release = '--release'
407 whole_window = '--whole-window'
409 exclude_titlebar = '--exclude-titlebar'
411 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
418 state MODE_BINDCOMMAND:
419 release = '--release'
423 whole_window = '--whole-window'
425 exclude_titlebar = '--exclude-titlebar'
428 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
430 ################################################################################
431 # Bar configuration (i3bar)
432 ################################################################################
438 -> call cfg_bar_start(); BAR
443 '#' -> BAR_IGNORE_LINE
444 'set' -> BAR_IGNORE_LINE
445 'i3bar_command' -> BAR_BAR_COMMAND
446 'status_command' -> BAR_STATUS_COMMAND
447 'socket_path' -> BAR_SOCKET_PATH
449 'hidden_state' -> BAR_HIDDEN_STATE
451 'modifier' -> BAR_MODIFIER
452 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
453 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
454 'bindsym' -> BAR_BINDSYM
455 'position' -> BAR_POSITION
456 'output' -> BAR_OUTPUT
457 'tray_output' -> BAR_TRAY_OUTPUT
458 'tray_padding' -> BAR_TRAY_PADDING
460 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
461 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
462 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
463 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
464 'strip_workspace_name' -> BAR_STRIP_WORKSPACE_NAME
465 'verbose' -> BAR_VERBOSE
466 'colors' -> BAR_COLORS_BRACE
468 -> call cfg_bar_finish(); INITIAL
470 # We ignore comments and 'set' lines (variables).
471 state BAR_IGNORE_LINE:
475 state BAR_BAR_COMMAND:
477 -> call cfg_bar_i3bar_command($command); BAR
479 state BAR_STATUS_COMMAND:
481 -> call cfg_bar_status_command($command); BAR
483 state BAR_SOCKET_PATH:
485 -> call cfg_bar_socket_path($path); BAR
488 mode = 'dock', 'hide', 'invisible'
489 -> call cfg_bar_mode($mode); BAR
491 state BAR_HIDDEN_STATE:
492 hidden_state = 'hide', 'show'
493 -> call cfg_bar_hidden_state($hidden_state); BAR
497 -> call cfg_bar_id($bar_id); BAR
501 -> call cfg_bar_modifier(NULL); BAR
502 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
507 -> call cfg_bar_modifier($modifiers); BAR
509 state BAR_WHEEL_UP_CMD:
511 -> call cfg_bar_wheel_up_cmd($command); BAR
513 state BAR_WHEEL_DOWN_CMD:
515 -> call cfg_bar_wheel_down_cmd($command); BAR
518 release = '--release'
521 -> BAR_BINDSYM_COMMAND
523 state BAR_BINDSYM_COMMAND:
524 release = '--release'
527 -> call cfg_bar_bindsym($button, $release, $command); BAR
530 position = 'top', 'bottom'
531 -> call cfg_bar_position($position); BAR
535 -> call cfg_bar_output($output); BAR
537 state BAR_TRAY_OUTPUT:
539 -> call cfg_bar_tray_output($output); BAR
541 state BAR_TRAY_PADDING:
543 -> BAR_TRAY_PADDING_PX
545 state BAR_TRAY_PADDING_PX:
549 -> call cfg_bar_tray_padding(&padding_px); BAR
553 -> call cfg_bar_font($font); BAR
555 state BAR_SEPARATOR_SYMBOL:
557 -> call cfg_bar_separator_symbol($separator); BAR
559 state BAR_BINDING_MODE_INDICATOR:
561 -> call cfg_bar_binding_mode_indicator($value); BAR
563 state BAR_WORKSPACE_BUTTONS:
565 -> call cfg_bar_workspace_buttons($value); BAR
567 state BAR_STRIP_WORKSPACE_NUMBERS:
569 -> call cfg_bar_strip_workspace_numbers($value); BAR
571 state BAR_STRIP_WORKSPACE_NAME:
573 -> call cfg_bar_strip_workspace_name($value); BAR
577 -> call cfg_bar_verbose($value); BAR
579 state BAR_COLORS_BRACE:
587 '#' -> BAR_COLORS_IGNORE_LINE
588 'set' -> BAR_COLORS_IGNORE_LINE
589 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
591 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
596 # We ignore comments and 'set' lines (variables).
597 state BAR_COLORS_IGNORE_LINE:
601 state BAR_COLORS_SINGLE:
603 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
605 state BAR_COLORS_BORDER:
607 -> BAR_COLORS_BACKGROUND
609 state BAR_COLORS_BACKGROUND:
613 state BAR_COLORS_TEXT:
615 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
617 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS