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 | output] <name>
148 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
150 state ASSIGN_WORKSPACE:
158 -> ASSIGN_WORKSPACE_NUMBER
160 -> call cfg_assign($workspace, 0)
164 -> call cfg_assign_output($output)
166 state ASSIGN_WORKSPACE_NUMBER:
168 -> call cfg_assign($number, 1)
170 # no_focus <criteria>
173 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
177 -> call cfg_no_focus()
179 # Criteria: Used by for_window and assign.
181 ctype = 'class' -> CRITERION
182 ctype = 'instance' -> CRITERION
183 ctype = 'window_role' -> CRITERION
184 ctype = 'con_id' -> CRITERION
185 ctype = 'id' -> CRITERION
186 ctype = 'window_type' -> CRITERION
187 ctype = 'con_mark' -> CRITERION
188 ctype = 'title' -> CRITERION
189 ctype = 'urgent' -> CRITERION
190 ctype = 'workspace' -> CRITERION
191 ctype = 'tiling', 'floating'
192 -> call cfg_criteria_add($ctype, NULL); CRITERIA
194 -> call cfg_criteria_pop_state()
201 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
203 # focus_follows_mouse bool
204 state FOCUS_FOLLOWS_MOUSE:
206 -> call cfg_focus_follows_mouse($value)
208 # mouse_warping warping_t
210 value = 'none', 'output'
211 -> call cfg_mouse_warping($value)
214 state FOCUS_WRAPPING:
215 value = '1', 'yes', 'true', 'on', 'enable', 'active', '0', 'no', 'false', 'off', 'disable', 'inactive', 'force'
216 -> call cfg_focus_wrapping($value)
218 # force_focus_wrapping
219 state FORCE_FOCUS_WRAPPING:
221 -> call cfg_force_focus_wrapping($value)
224 state FORCE_XINERAMA:
226 -> call cfg_force_xinerama($value)
229 state DISABLE_RANDR15:
231 -> call cfg_disable_randr15($value)
233 # workspace_back_and_forth
234 state WORKSPACE_BACK_AND_FORTH:
236 -> call cfg_workspace_back_and_forth($value)
239 # fake_outputs (for testcases)
242 -> call cfg_fake_outputs($outputs)
244 # force_display_urgency_hint <timeout> ms
245 state FORCE_DISPLAY_URGENCY_HINT:
247 -> FORCE_DISPLAY_URGENCY_HINT_MS
252 -> call cfg_show_marks($value)
254 state FORCE_DISPLAY_URGENCY_HINT_MS:
258 -> call cfg_force_display_urgency_hint(&duration_ms)
260 # focus_on_window_activation <smart|urgent|focus|none>
261 state FOCUS_ON_WINDOW_ACTIVATION:
263 -> call cfg_focus_on_window_activation($mode)
265 # workspace <workspace> output <output>
270 state WORKSPACE_OUTPUT:
272 -> WORKSPACE_OUTPUT_STR
274 state WORKSPACE_OUTPUT_STR:
276 -> call cfg_workspace($workspace, $output)
281 -> call cfg_ipc_socket($path)
283 # restart_state <path> (for testcases)
286 -> call cfg_restart_state($path)
288 # popup_during_fullscreen
289 state POPUP_DURING_FULLSCREEN:
290 value = 'ignore', 'leave_fullscreen', 'smart'
291 -> call cfg_popup_during_fullscreen($value)
293 # client.background <hexcolor>
296 -> call cfg_color_single($colorclass, $color)
298 # colorclass border background text indicator
303 state COLOR_BACKGROUND:
311 state COLOR_INDICATOR:
313 -> COLOR_CHILD_BORDER
315 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
317 state COLOR_CHILD_BORDER:
319 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
321 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
323 # <exec|exec_always> [--no-startup-id] command
325 no_startup_id = '--no-startup-id'
328 -> call cfg_exec($exectype, $no_startup_id, $command)
333 -> call cfg_font($font)
337 release = '--release'
341 whole_window = '--whole-window'
343 exclude_titlebar = '--exclude-titlebar'
345 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
353 release = '--release'
357 whole_window = '--whole-window'
359 exclude_titlebar = '--exclude-titlebar'
362 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
364 ################################################################################
366 ################################################################################
369 pango_markup = '--pango_markup'
372 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
383 '#' -> MODE_IGNORE_LINE
384 'set' -> MODE_IGNORE_LINE
385 bindtype = 'bindsym', 'bindcode', 'bind'
390 # We ignore comments and 'set' lines (variables).
391 state MODE_IGNORE_LINE:
396 release = '--release'
400 whole_window = '--whole-window'
402 exclude_titlebar = '--exclude-titlebar'
404 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
411 state MODE_BINDCOMMAND:
412 release = '--release'
416 whole_window = '--whole-window'
418 exclude_titlebar = '--exclude-titlebar'
421 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
423 ################################################################################
424 # Bar configuration (i3bar)
425 ################################################################################
431 -> call cfg_bar_start(); BAR
436 '#' -> BAR_IGNORE_LINE
437 'set' -> BAR_IGNORE_LINE
438 'i3bar_command' -> BAR_BAR_COMMAND
439 'status_command' -> BAR_STATUS_COMMAND
440 'socket_path' -> BAR_SOCKET_PATH
442 'hidden_state' -> BAR_HIDDEN_STATE
444 'modifier' -> BAR_MODIFIER
445 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
446 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
447 'bindsym' -> BAR_BINDSYM
448 'position' -> BAR_POSITION
449 'output' -> BAR_OUTPUT
450 'tray_output' -> BAR_TRAY_OUTPUT
451 'tray_padding' -> BAR_TRAY_PADDING
453 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
454 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
455 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
456 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
457 'verbose' -> BAR_VERBOSE
458 'colors' -> BAR_COLORS_BRACE
460 -> call cfg_bar_finish(); INITIAL
462 # We ignore comments and 'set' lines (variables).
463 state BAR_IGNORE_LINE:
467 state BAR_BAR_COMMAND:
469 -> call cfg_bar_i3bar_command($command); BAR
471 state BAR_STATUS_COMMAND:
473 -> call cfg_bar_status_command($command); BAR
475 state BAR_SOCKET_PATH:
477 -> call cfg_bar_socket_path($path); BAR
480 mode = 'dock', 'hide', 'invisible'
481 -> call cfg_bar_mode($mode); BAR
483 state BAR_HIDDEN_STATE:
484 hidden_state = 'hide', 'show'
485 -> call cfg_bar_hidden_state($hidden_state); BAR
489 -> call cfg_bar_id($bar_id); BAR
492 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
493 -> call cfg_bar_modifier($modifier); BAR
495 state BAR_WHEEL_UP_CMD:
497 -> call cfg_bar_wheel_up_cmd($command); BAR
499 state BAR_WHEEL_DOWN_CMD:
501 -> call cfg_bar_wheel_down_cmd($command); BAR
505 -> BAR_BINDSYM_COMMAND
507 state BAR_BINDSYM_COMMAND:
509 -> call cfg_bar_bindsym($button, $command); BAR
512 position = 'top', 'bottom'
513 -> call cfg_bar_position($position); BAR
517 -> call cfg_bar_output($output); BAR
519 state BAR_TRAY_OUTPUT:
521 -> call cfg_bar_tray_output($output); BAR
523 state BAR_TRAY_PADDING:
525 -> BAR_TRAY_PADDING_PX
527 state BAR_TRAY_PADDING_PX:
531 -> call cfg_bar_tray_padding(&padding_px); BAR
535 -> call cfg_bar_font($font); BAR
537 state BAR_SEPARATOR_SYMBOL:
539 -> call cfg_bar_separator_symbol($separator); BAR
541 state BAR_BINDING_MODE_INDICATOR:
543 -> call cfg_bar_binding_mode_indicator($value); BAR
545 state BAR_WORKSPACE_BUTTONS:
547 -> call cfg_bar_workspace_buttons($value); BAR
549 state BAR_STRIP_WORKSPACE_NUMBERS:
551 -> call cfg_bar_strip_workspace_numbers($value); BAR
555 -> call cfg_bar_verbose($value); BAR
557 state BAR_COLORS_BRACE:
565 '#' -> BAR_COLORS_IGNORE_LINE
566 'set' -> BAR_COLORS_IGNORE_LINE
567 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
569 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
574 # We ignore comments and 'set' lines (variables).
575 state BAR_COLORS_IGNORE_LINE:
579 state BAR_COLORS_SINGLE:
581 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
583 state BAR_COLORS_BORDER:
585 -> BAR_COLORS_BACKGROUND
587 state BAR_COLORS_BACKGROUND:
591 state BAR_COLORS_TEXT:
593 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
595 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS