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.
21 'set_from_resource' -> IGNORE_LINE
22 bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
26 'floating_minimum_size' -> FLOATING_MINIMUM_SIZE_WIDTH
27 'floating_maximum_size' -> FLOATING_MAXIMUM_SIZE_WIDTH
28 'floating_modifier' -> FLOATING_MODIFIER
29 'default_orientation' -> DEFAULT_ORIENTATION
30 'workspace_layout' -> WORKSPACE_LAYOUT
31 windowtype = 'new_window', 'new_float' -> NEW_WINDOW
32 'hide_edge_borders' -> HIDE_EDGE_BORDERS
33 'for_window' -> FOR_WINDOW
35 'no_focus' -> NO_FOCUS
36 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
37 'mouse_warping' -> MOUSE_WARPING
38 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
39 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
40 'disable_randr15', 'disable-randr15' -> DISABLE_RANDR15
41 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
42 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
43 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
44 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
45 'show_marks' -> SHOW_MARKS
46 'workspace' -> WORKSPACE
47 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
48 'restart_state' -> RESTART_STATE
49 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
50 exectype = 'exec_always', 'exec' -> EXEC
51 colorclass = 'client.background'
53 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
56 # We ignore comments and 'set' lines (variables).
61 # floating_minimum_size <width> x <height>
62 state FLOATING_MINIMUM_SIZE_WIDTH:
64 -> FLOATING_MINIMUM_SIZE_X
66 state FLOATING_MINIMUM_SIZE_X:
68 -> FLOATING_MINIMUM_SIZE_HEIGHT
70 state FLOATING_MINIMUM_SIZE_HEIGHT:
72 -> call cfg_floating_minimum_size(&width, &height)
74 # floating_maximum_size <width> x <height>
75 state FLOATING_MAXIMUM_SIZE_WIDTH:
77 -> FLOATING_MAXIMUM_SIZE_X
79 state FLOATING_MAXIMUM_SIZE_X:
81 -> FLOATING_MAXIMUM_SIZE_HEIGHT
83 state FLOATING_MAXIMUM_SIZE_HEIGHT:
85 -> call cfg_floating_maximum_size(&width, &height)
87 # floating_modifier <modifier>
88 state FLOATING_MODIFIER:
89 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
94 -> call cfg_floating_modifier($modifiers)
96 # default_orientation <horizontal|vertical|auto>
97 state DEFAULT_ORIENTATION:
98 orientation = 'horizontal', 'vertical', 'auto'
99 -> call cfg_default_orientation($orientation)
101 # workspace_layout <default|stacking|tabbed>
102 state WORKSPACE_LAYOUT:
103 layout = 'default', 'stacking', 'stacked', 'tabbed'
104 -> call cfg_workspace_layout($layout)
106 # new_window <normal|1pixel|none>
107 # new_float <normal|1pixel|none>
109 border = 'normal', 'pixel'
111 border = '1pixel', 'none'
112 -> call cfg_new_window($windowtype, $border, -1)
114 state NEW_WINDOW_PIXELS:
116 -> call cfg_new_window($windowtype, $border, 2)
118 -> NEW_WINDOW_PIXELS_PX
120 state NEW_WINDOW_PIXELS_PX:
124 -> call cfg_new_window($windowtype, $border, &width)
126 # hide_edge_borders <none|vertical|horizontal|both|smart>
127 # also hide_edge_borders <bool> for compatibility
128 state HIDE_EDGE_BORDERS:
129 hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
130 -> call cfg_hide_edge_borders($hide_borders)
131 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
132 -> call cfg_hide_edge_borders($hide_borders)
134 # for_window <criteria> command
137 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
139 state FOR_WINDOW_COMMAND:
141 -> call cfg_for_window($command)
143 # assign <criteria> [→] workspace
146 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
148 state ASSIGN_WORKSPACE:
154 -> call cfg_assign($workspace)
156 # no_focus <criteria>
159 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
163 -> call cfg_no_focus()
165 # Criteria: Used by for_window and assign.
167 ctype = 'class' -> CRITERION
168 ctype = 'instance' -> CRITERION
169 ctype = 'window_role' -> CRITERION
170 ctype = 'con_id' -> CRITERION
171 ctype = 'id' -> CRITERION
172 ctype = 'window_type' -> CRITERION
173 ctype = 'con_mark' -> CRITERION
174 ctype = 'title' -> CRITERION
175 ctype = 'urgent' -> CRITERION
176 ctype = 'workspace' -> CRITERION
177 ctype = 'tiling', 'floating'
178 -> call cfg_criteria_add($ctype, NULL); CRITERIA
180 -> call cfg_criteria_pop_state()
187 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
189 # focus_follows_mouse bool
190 state FOCUS_FOLLOWS_MOUSE:
192 -> call cfg_focus_follows_mouse($value)
194 # mouse_warping warping_t
196 value = 'none', 'output'
197 -> call cfg_mouse_warping($value)
199 # force_focus_wrapping
200 state FORCE_FOCUS_WRAPPING:
202 -> call cfg_force_focus_wrapping($value)
205 state FORCE_XINERAMA:
207 -> call cfg_force_xinerama($value)
210 state DISABLE_RANDR15:
212 -> call cfg_disable_randr15($value)
214 # workspace_back_and_forth
215 state WORKSPACE_BACK_AND_FORTH:
217 -> call cfg_workspace_back_and_forth($value)
220 # fake_outputs (for testcases)
223 -> call cfg_fake_outputs($outputs)
225 # force_display_urgency_hint <timeout> ms
226 state FORCE_DISPLAY_URGENCY_HINT:
228 -> FORCE_DISPLAY_URGENCY_HINT_MS
233 -> call cfg_show_marks($value)
235 state FORCE_DISPLAY_URGENCY_HINT_MS:
239 -> call cfg_force_display_urgency_hint(&duration_ms)
241 # focus_on_window_activation <smart|urgent|focus|none>
242 state FOCUS_ON_WINDOW_ACTIVATION:
244 -> call cfg_focus_on_window_activation($mode)
246 # workspace <workspace> output <output>
251 state WORKSPACE_OUTPUT:
253 -> WORKSPACE_OUTPUT_STR
255 state WORKSPACE_OUTPUT_STR:
257 -> call cfg_workspace($workspace, $output)
262 -> call cfg_ipc_socket($path)
264 # restart_state <path> (for testcases)
267 -> call cfg_restart_state($path)
269 # popup_during_fullscreen
270 state POPUP_DURING_FULLSCREEN:
271 value = 'ignore', 'leave_fullscreen', 'smart'
272 -> call cfg_popup_during_fullscreen($value)
274 # client.background <hexcolor>
277 -> call cfg_color_single($colorclass, $color)
279 # colorclass border background text indicator
284 state COLOR_BACKGROUND:
292 state COLOR_INDICATOR:
294 -> COLOR_CHILD_BORDER
296 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
298 state COLOR_CHILD_BORDER:
300 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
302 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
304 # <exec|exec_always> [--no-startup-id] command
306 no_startup_id = '--no-startup-id'
309 -> call cfg_exec($exectype, $no_startup_id, $command)
314 -> call cfg_font($font)
318 release = '--release'
322 whole_window = '--whole-window'
324 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
332 release = '--release'
336 whole_window = '--whole-window'
339 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command)
341 ################################################################################
343 ################################################################################
346 pango_markup = '--pango_markup'
349 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
360 '#' -> MODE_IGNORE_LINE
361 'set' -> MODE_IGNORE_LINE
362 bindtype = 'bindsym', 'bindcode', 'bind'
367 # We ignore comments and 'set' lines (variables).
368 state MODE_IGNORE_LINE:
373 release = '--release'
377 whole_window = '--whole-window'
379 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
386 state MODE_BINDCOMMAND:
387 release = '--release'
391 whole_window = '--whole-window'
394 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command); MODE
396 ################################################################################
397 # Bar configuration (i3bar)
398 ################################################################################
404 -> call cfg_bar_start(); BAR
409 '#' -> BAR_IGNORE_LINE
410 'set' -> BAR_IGNORE_LINE
411 'i3bar_command' -> BAR_BAR_COMMAND
412 'status_command' -> BAR_STATUS_COMMAND
413 'socket_path' -> BAR_SOCKET_PATH
415 'hidden_state' -> BAR_HIDDEN_STATE
417 'modifier' -> BAR_MODIFIER
418 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
419 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
420 'bindsym' -> BAR_BINDSYM
421 'position' -> BAR_POSITION
422 'output' -> BAR_OUTPUT
423 'tray_output' -> BAR_TRAY_OUTPUT
424 'tray_padding' -> BAR_TRAY_PADDING
426 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
427 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
428 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
429 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
430 'verbose' -> BAR_VERBOSE
431 'colors' -> BAR_COLORS_BRACE
433 -> call cfg_bar_finish(); INITIAL
435 # We ignore comments and 'set' lines (variables).
436 state BAR_IGNORE_LINE:
440 state BAR_BAR_COMMAND:
442 -> call cfg_bar_i3bar_command($command); BAR
444 state BAR_STATUS_COMMAND:
446 -> call cfg_bar_status_command($command); BAR
448 state BAR_SOCKET_PATH:
450 -> call cfg_bar_socket_path($path); BAR
453 mode = 'dock', 'hide', 'invisible'
454 -> call cfg_bar_mode($mode); BAR
456 state BAR_HIDDEN_STATE:
457 hidden_state = 'hide', 'show'
458 -> call cfg_bar_hidden_state($hidden_state); BAR
462 -> call cfg_bar_id($bar_id); BAR
465 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
466 -> call cfg_bar_modifier($modifier); BAR
468 state BAR_WHEEL_UP_CMD:
470 -> call cfg_bar_wheel_up_cmd($command); BAR
472 state BAR_WHEEL_DOWN_CMD:
474 -> call cfg_bar_wheel_down_cmd($command); BAR
478 -> BAR_BINDSYM_COMMAND
480 state BAR_BINDSYM_COMMAND:
482 -> call cfg_bar_bindsym($button, $command); BAR
485 position = 'top', 'bottom'
486 -> call cfg_bar_position($position); BAR
490 -> call cfg_bar_output($output); BAR
492 state BAR_TRAY_OUTPUT:
494 -> call cfg_bar_tray_output($output); BAR
496 state BAR_TRAY_PADDING:
498 -> BAR_TRAY_PADDING_PX
500 state BAR_TRAY_PADDING_PX:
504 -> call cfg_bar_tray_padding(&padding_px); BAR
508 -> call cfg_bar_font($font); BAR
510 state BAR_SEPARATOR_SYMBOL:
512 -> call cfg_bar_separator_symbol($separator); BAR
514 state BAR_BINDING_MODE_INDICATOR:
516 -> call cfg_bar_binding_mode_indicator($value); BAR
518 state BAR_WORKSPACE_BUTTONS:
520 -> call cfg_bar_workspace_buttons($value); BAR
522 state BAR_STRIP_WORKSPACE_NUMBERS:
524 -> call cfg_bar_strip_workspace_numbers($value); BAR
528 -> call cfg_bar_verbose($value); BAR
530 state BAR_COLORS_BRACE:
538 '#' -> BAR_COLORS_IGNORE_LINE
539 'set' -> BAR_COLORS_IGNORE_LINE
540 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
542 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
547 # We ignore comments and 'set' lines (variables).
548 state BAR_COLORS_IGNORE_LINE:
552 state BAR_COLORS_SINGLE:
554 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
556 state BAR_COLORS_BORDER:
558 -> BAR_COLORS_BACKGROUND
560 state BAR_COLORS_BACKGROUND:
564 state BAR_COLORS_TEXT:
566 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
568 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS