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_STR
282 state WORKSPACE_OUTPUT_STR:
284 -> call cfg_workspace($workspace, $output)
289 -> call cfg_ipc_socket($path)
292 state IPC_KILL_TIMEOUT:
294 -> call cfg_ipc_kill_timeout(&timeout)
296 # restart_state <path> (for testcases)
299 -> call cfg_restart_state($path)
301 # popup_during_fullscreen
302 state POPUP_DURING_FULLSCREEN:
303 value = 'ignore', 'leave_fullscreen', 'smart'
304 -> call cfg_popup_during_fullscreen($value)
306 # client.background <hexcolor>
309 -> call cfg_color_single($colorclass, $color)
311 # colorclass border background text indicator
316 state COLOR_BACKGROUND:
324 state COLOR_INDICATOR:
326 -> COLOR_CHILD_BORDER
328 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
330 state COLOR_CHILD_BORDER:
332 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
334 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
336 # <exec|exec_always> [--no-startup-id] command
338 no_startup_id = '--no-startup-id'
341 -> call cfg_exec($exectype, $no_startup_id, $command)
346 -> call cfg_font($font)
350 release = '--release'
354 whole_window = '--whole-window'
356 exclude_titlebar = '--exclude-titlebar'
358 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
366 release = '--release'
370 whole_window = '--whole-window'
372 exclude_titlebar = '--exclude-titlebar'
375 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
377 ################################################################################
379 ################################################################################
382 pango_markup = '--pango_markup'
385 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
396 '#' -> MODE_IGNORE_LINE
397 'set' -> MODE_IGNORE_LINE
398 bindtype = 'bindsym', 'bindcode', 'bind'
403 # We ignore comments and 'set' lines (variables).
404 state MODE_IGNORE_LINE:
409 release = '--release'
413 whole_window = '--whole-window'
415 exclude_titlebar = '--exclude-titlebar'
417 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
424 state MODE_BINDCOMMAND:
425 release = '--release'
429 whole_window = '--whole-window'
431 exclude_titlebar = '--exclude-titlebar'
434 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
436 ################################################################################
437 # Bar configuration (i3bar)
438 ################################################################################
444 -> call cfg_bar_start(); BAR
449 '#' -> BAR_IGNORE_LINE
450 'set' -> BAR_IGNORE_LINE
451 'i3bar_command' -> BAR_BAR_COMMAND
452 'status_command' -> BAR_STATUS_COMMAND
453 'socket_path' -> BAR_SOCKET_PATH
455 'hidden_state' -> BAR_HIDDEN_STATE
457 'modifier' -> BAR_MODIFIER
458 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
459 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
460 'bindsym' -> BAR_BINDSYM
461 'position' -> BAR_POSITION
462 'output' -> BAR_OUTPUT
463 'tray_output' -> BAR_TRAY_OUTPUT
464 'tray_padding' -> BAR_TRAY_PADDING
466 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
467 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
468 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
469 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
470 'strip_workspace_name' -> BAR_STRIP_WORKSPACE_NAME
471 'verbose' -> BAR_VERBOSE
472 'colors' -> BAR_COLORS_BRACE
474 -> call cfg_bar_finish(); INITIAL
476 # We ignore comments and 'set' lines (variables).
477 state BAR_IGNORE_LINE:
481 state BAR_BAR_COMMAND:
483 -> call cfg_bar_i3bar_command($command); BAR
485 state BAR_STATUS_COMMAND:
487 -> call cfg_bar_status_command($command); BAR
489 state BAR_SOCKET_PATH:
491 -> call cfg_bar_socket_path($path); BAR
494 mode = 'dock', 'hide', 'invisible'
495 -> call cfg_bar_mode($mode); BAR
497 state BAR_HIDDEN_STATE:
498 hidden_state = 'hide', 'show'
499 -> call cfg_bar_hidden_state($hidden_state); BAR
503 -> call cfg_bar_id($bar_id); BAR
507 -> call cfg_bar_modifier(NULL); BAR
508 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
513 -> call cfg_bar_modifier($modifiers); BAR
515 state BAR_WHEEL_UP_CMD:
517 -> call cfg_bar_wheel_up_cmd($command); BAR
519 state BAR_WHEEL_DOWN_CMD:
521 -> call cfg_bar_wheel_down_cmd($command); BAR
524 release = '--release'
527 -> BAR_BINDSYM_COMMAND
529 state BAR_BINDSYM_COMMAND:
530 release = '--release'
533 -> call cfg_bar_bindsym($button, $release, $command); BAR
536 position = 'top', 'bottom'
537 -> call cfg_bar_position($position); BAR
541 -> call cfg_bar_output($output); BAR
543 state BAR_TRAY_OUTPUT:
545 -> call cfg_bar_tray_output($output); BAR
547 state BAR_TRAY_PADDING:
549 -> BAR_TRAY_PADDING_PX
551 state BAR_TRAY_PADDING_PX:
555 -> call cfg_bar_tray_padding(&padding_px); BAR
559 -> call cfg_bar_font($font); BAR
561 state BAR_SEPARATOR_SYMBOL:
563 -> call cfg_bar_separator_symbol($separator); BAR
565 state BAR_BINDING_MODE_INDICATOR:
567 -> call cfg_bar_binding_mode_indicator($value); BAR
569 state BAR_WORKSPACE_BUTTONS:
571 -> call cfg_bar_workspace_buttons($value); BAR
573 state BAR_STRIP_WORKSPACE_NUMBERS:
575 -> call cfg_bar_strip_workspace_numbers($value); BAR
577 state BAR_STRIP_WORKSPACE_NAME:
579 -> call cfg_bar_strip_workspace_name($value); BAR
583 -> call cfg_bar_verbose($value); BAR
585 state BAR_COLORS_BRACE:
593 '#' -> BAR_COLORS_IGNORE_LINE
594 'set' -> BAR_COLORS_IGNORE_LINE
595 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
597 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
602 # We ignore comments and 'set' lines (variables).
603 state BAR_COLORS_IGNORE_LINE:
607 state BAR_COLORS_SINGLE:
609 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
611 state BAR_COLORS_BORDER:
613 -> BAR_COLORS_BACKGROUND
615 state BAR_COLORS_BACKGROUND:
619 state BAR_COLORS_TEXT:
621 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
623 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS