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 'title_align' -> TITLE_ALIGN
49 'show_marks' -> SHOW_MARKS
50 'workspace' -> WORKSPACE
51 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
52 'ipc_kill_timeout' -> IPC_KILL_TIMEOUT
53 'restart_state' -> RESTART_STATE
54 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
55 exectype = 'exec_always', 'exec' -> EXEC
56 colorclass = 'client.background'
58 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
61 # We ignore comments and 'set' lines (variables).
66 # floating_minimum_size <width> x <height>
67 state FLOATING_MINIMUM_SIZE_WIDTH:
69 -> FLOATING_MINIMUM_SIZE_X
71 state FLOATING_MINIMUM_SIZE_X:
73 -> FLOATING_MINIMUM_SIZE_HEIGHT
75 state FLOATING_MINIMUM_SIZE_HEIGHT:
77 -> call cfg_floating_minimum_size(&width, &height)
79 # floating_maximum_size <width> x <height>
80 state FLOATING_MAXIMUM_SIZE_WIDTH:
82 -> FLOATING_MAXIMUM_SIZE_X
84 state FLOATING_MAXIMUM_SIZE_X:
86 -> FLOATING_MAXIMUM_SIZE_HEIGHT
88 state FLOATING_MAXIMUM_SIZE_HEIGHT:
90 -> call cfg_floating_maximum_size(&width, &height)
92 # floating_modifier <modifier>
93 state FLOATING_MODIFIER:
94 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
99 -> call cfg_floating_modifier($modifiers)
101 # default_orientation <horizontal|vertical|auto>
102 state DEFAULT_ORIENTATION:
103 orientation = 'horizontal', 'vertical', 'auto'
104 -> call cfg_default_orientation($orientation)
106 # workspace_layout <default|stacking|tabbed>
107 state WORKSPACE_LAYOUT:
108 layout = 'default', 'stacking', 'stacked', 'tabbed'
109 -> call cfg_workspace_layout($layout)
111 # <default_border|new_window> <normal|1pixel|none>
112 # <default_floating_border|new_float> <normal|1pixel|none>
113 state DEFAULT_BORDER:
114 border = 'normal', 'pixel'
115 -> DEFAULT_BORDER_PIXELS
116 border = '1pixel', 'none'
117 -> call cfg_default_border($windowtype, $border, -1)
119 state DEFAULT_BORDER_PIXELS:
121 -> call cfg_default_border($windowtype, $border, 2)
123 -> DEFAULT_BORDER_PIXELS_PX
125 state DEFAULT_BORDER_PIXELS_PX:
129 -> call cfg_default_border($windowtype, $border, &width)
131 # hide_edge_borders <none|vertical|horizontal|both|smart>
132 # also hide_edge_borders <bool> for compatibility
133 state HIDE_EDGE_BORDERS:
134 hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
135 -> call cfg_hide_edge_borders($hide_borders)
136 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
137 -> call cfg_hide_edge_borders($hide_borders)
139 # for_window <criteria> command
142 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
144 state FOR_WINDOW_COMMAND:
146 -> call cfg_for_window($command)
148 # assign <criteria> [→] [workspace | output] <name>
151 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
153 state ASSIGN_WORKSPACE:
161 -> ASSIGN_WORKSPACE_NUMBER
163 -> call cfg_assign($workspace, 0)
167 -> call cfg_assign_output($output)
169 state ASSIGN_WORKSPACE_NUMBER:
171 -> call cfg_assign($number, 1)
173 # no_focus <criteria>
176 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
180 -> call cfg_no_focus()
182 # Criteria: Used by for_window and assign.
184 ctype = 'class' -> CRITERION
185 ctype = 'instance' -> CRITERION
186 ctype = 'window_role' -> CRITERION
187 ctype = 'con_id' -> CRITERION
188 ctype = 'id' -> CRITERION
189 ctype = 'window_type' -> CRITERION
190 ctype = 'con_mark' -> CRITERION
191 ctype = 'title' -> CRITERION
192 ctype = 'urgent' -> CRITERION
193 ctype = 'workspace' -> CRITERION
194 ctype = 'tiling', 'floating'
195 -> call cfg_criteria_add($ctype, NULL); CRITERIA
197 -> call cfg_criteria_pop_state()
204 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
206 # focus_follows_mouse bool
207 state FOCUS_FOLLOWS_MOUSE:
209 -> call cfg_focus_follows_mouse($value)
211 # mouse_warping warping_t
213 value = 'none', 'output'
214 -> call cfg_mouse_warping($value)
217 state FOCUS_WRAPPING:
218 value = '1', 'yes', 'true', 'on', 'enable', 'active', '0', 'no', 'false', 'off', 'disable', 'inactive', 'force'
219 -> call cfg_focus_wrapping($value)
221 # force_focus_wrapping
222 state FORCE_FOCUS_WRAPPING:
224 -> call cfg_force_focus_wrapping($value)
227 state FORCE_XINERAMA:
229 -> call cfg_force_xinerama($value)
232 state DISABLE_RANDR15:
234 -> call cfg_disable_randr15($value)
236 # workspace_back_and_forth
237 state WORKSPACE_BACK_AND_FORTH:
239 -> call cfg_workspace_back_and_forth($value)
242 # fake_outputs (for testcases)
245 -> call cfg_fake_outputs($outputs)
247 # force_display_urgency_hint <timeout> ms
248 state FORCE_DISPLAY_URGENCY_HINT:
250 -> FORCE_DISPLAY_URGENCY_HINT_MS
252 # title_align [left|center|right]
254 alignment = 'left', 'center', 'right'
255 -> call cfg_title_align($alignment)
260 -> call cfg_show_marks($value)
262 state FORCE_DISPLAY_URGENCY_HINT_MS:
266 -> call cfg_force_display_urgency_hint(&duration_ms)
268 # focus_on_window_activation <smart|urgent|focus|none>
269 state FOCUS_ON_WINDOW_ACTIVATION:
271 -> call cfg_focus_on_window_activation($mode)
273 # workspace <workspace> output <output>
278 state WORKSPACE_OUTPUT:
280 -> WORKSPACE_OUTPUT_WORD
282 state WORKSPACE_OUTPUT_WORD:
284 -> call cfg_workspace($workspace, $output); WORKSPACE_OUTPUT_WORD
291 -> call cfg_ipc_socket($path)
294 state IPC_KILL_TIMEOUT:
296 -> call cfg_ipc_kill_timeout(&timeout)
298 # restart_state <path> (for testcases)
301 -> call cfg_restart_state($path)
303 # popup_during_fullscreen
304 state POPUP_DURING_FULLSCREEN:
305 value = 'ignore', 'leave_fullscreen', 'smart'
306 -> call cfg_popup_during_fullscreen($value)
308 # client.background <hexcolor>
311 -> call cfg_color_single($colorclass, $color)
313 # colorclass border background text indicator
318 state COLOR_BACKGROUND:
326 state COLOR_INDICATOR:
328 -> COLOR_CHILD_BORDER
330 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
332 state COLOR_CHILD_BORDER:
334 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
336 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
338 # <exec|exec_always> [--no-startup-id] command
340 no_startup_id = '--no-startup-id'
343 -> call cfg_exec($exectype, $no_startup_id, $command)
348 -> call cfg_font($font)
352 release = '--release'
356 whole_window = '--whole-window'
358 exclude_titlebar = '--exclude-titlebar'
360 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
368 release = '--release'
372 whole_window = '--whole-window'
374 exclude_titlebar = '--exclude-titlebar'
377 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
379 ################################################################################
381 ################################################################################
384 pango_markup = '--pango_markup'
387 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
398 '#' -> MODE_IGNORE_LINE
399 'set' -> MODE_IGNORE_LINE
400 bindtype = 'bindsym', 'bindcode', 'bind'
405 # We ignore comments and 'set' lines (variables).
406 state MODE_IGNORE_LINE:
411 release = '--release'
415 whole_window = '--whole-window'
417 exclude_titlebar = '--exclude-titlebar'
419 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
426 state MODE_BINDCOMMAND:
427 release = '--release'
431 whole_window = '--whole-window'
433 exclude_titlebar = '--exclude-titlebar'
436 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
438 ################################################################################
439 # Bar configuration (i3bar)
440 ################################################################################
446 -> call cfg_bar_start(); BAR
451 '#' -> BAR_IGNORE_LINE
452 'set' -> BAR_IGNORE_LINE
453 'i3bar_command' -> BAR_BAR_COMMAND
454 'status_command' -> BAR_STATUS_COMMAND
455 'socket_path' -> BAR_SOCKET_PATH
457 'hidden_state' -> BAR_HIDDEN_STATE
459 'modifier' -> BAR_MODIFIER
460 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
461 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
462 'bindsym' -> BAR_BINDSYM
463 'position' -> BAR_POSITION
464 'output' -> BAR_OUTPUT
465 'tray_output' -> BAR_TRAY_OUTPUT
466 'tray_padding' -> BAR_TRAY_PADDING
468 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
469 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
470 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
471 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
472 'strip_workspace_name' -> BAR_STRIP_WORKSPACE_NAME
473 'verbose' -> BAR_VERBOSE
474 'colors' -> BAR_COLORS_BRACE
476 -> call cfg_bar_finish(); INITIAL
478 # We ignore comments and 'set' lines (variables).
479 state BAR_IGNORE_LINE:
483 state BAR_BAR_COMMAND:
485 -> call cfg_bar_i3bar_command($command); BAR
487 state BAR_STATUS_COMMAND:
489 -> call cfg_bar_status_command($command); BAR
491 state BAR_SOCKET_PATH:
493 -> call cfg_bar_socket_path($path); BAR
496 mode = 'dock', 'hide', 'invisible'
497 -> call cfg_bar_mode($mode); BAR
499 state BAR_HIDDEN_STATE:
500 hidden_state = 'hide', 'show'
501 -> call cfg_bar_hidden_state($hidden_state); BAR
505 -> call cfg_bar_id($bar_id); BAR
509 -> call cfg_bar_modifier(NULL); BAR
510 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
515 -> call cfg_bar_modifier($modifiers); BAR
517 state BAR_WHEEL_UP_CMD:
519 -> call cfg_bar_wheel_up_cmd($command); BAR
521 state BAR_WHEEL_DOWN_CMD:
523 -> call cfg_bar_wheel_down_cmd($command); BAR
526 release = '--release'
529 -> BAR_BINDSYM_COMMAND
531 state BAR_BINDSYM_COMMAND:
532 release = '--release'
535 -> call cfg_bar_bindsym($button, $release, $command); BAR
538 position = 'top', 'bottom'
539 -> call cfg_bar_position($position); BAR
543 -> call cfg_bar_output($output); BAR
545 state BAR_TRAY_OUTPUT:
547 -> call cfg_bar_tray_output($output); BAR
549 state BAR_TRAY_PADDING:
551 -> BAR_TRAY_PADDING_PX
553 state BAR_TRAY_PADDING_PX:
557 -> call cfg_bar_tray_padding(&padding_px); BAR
561 -> call cfg_bar_font($font); BAR
563 state BAR_SEPARATOR_SYMBOL:
565 -> call cfg_bar_separator_symbol($separator); BAR
567 state BAR_BINDING_MODE_INDICATOR:
569 -> call cfg_bar_binding_mode_indicator($value); BAR
571 state BAR_WORKSPACE_BUTTONS:
573 -> call cfg_bar_workspace_buttons($value); BAR
575 state BAR_STRIP_WORKSPACE_NUMBERS:
577 -> call cfg_bar_strip_workspace_numbers($value); BAR
579 state BAR_STRIP_WORKSPACE_NAME:
581 -> call cfg_bar_strip_workspace_name($value); BAR
585 -> call cfg_bar_verbose($value); BAR
587 state BAR_COLORS_BRACE:
595 '#' -> BAR_COLORS_IGNORE_LINE
596 'set' -> BAR_COLORS_IGNORE_LINE
597 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
599 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
604 # We ignore comments and 'set' lines (variables).
605 state BAR_COLORS_IGNORE_LINE:
609 state BAR_COLORS_SINGLE:
611 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
613 state BAR_COLORS_BORDER:
615 -> BAR_COLORS_BACKGROUND
617 state BAR_COLORS_BACKGROUND:
621 state BAR_COLORS_TEXT:
623 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
625 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS