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 'restart_state' -> RESTART_STATE
52 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
53 exectype = 'exec_always', 'exec' -> EXEC
54 colorclass = 'client.background'
56 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
59 # We ignore comments and 'set' lines (variables).
64 # floating_minimum_size <width> x <height>
65 state FLOATING_MINIMUM_SIZE_WIDTH:
67 -> FLOATING_MINIMUM_SIZE_X
69 state FLOATING_MINIMUM_SIZE_X:
71 -> FLOATING_MINIMUM_SIZE_HEIGHT
73 state FLOATING_MINIMUM_SIZE_HEIGHT:
75 -> call cfg_floating_minimum_size(&width, &height)
77 # floating_maximum_size <width> x <height>
78 state FLOATING_MAXIMUM_SIZE_WIDTH:
80 -> FLOATING_MAXIMUM_SIZE_X
82 state FLOATING_MAXIMUM_SIZE_X:
84 -> FLOATING_MAXIMUM_SIZE_HEIGHT
86 state FLOATING_MAXIMUM_SIZE_HEIGHT:
88 -> call cfg_floating_maximum_size(&width, &height)
90 # floating_modifier <modifier>
91 state FLOATING_MODIFIER:
92 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
97 -> call cfg_floating_modifier($modifiers)
99 # default_orientation <horizontal|vertical|auto>
100 state DEFAULT_ORIENTATION:
101 orientation = 'horizontal', 'vertical', 'auto'
102 -> call cfg_default_orientation($orientation)
104 # workspace_layout <default|stacking|tabbed>
105 state WORKSPACE_LAYOUT:
106 layout = 'default', 'stacking', 'stacked', 'tabbed'
107 -> call cfg_workspace_layout($layout)
109 # <default_border|new_window> <normal|1pixel|none>
110 # <default_floating_border|new_float> <normal|1pixel|none>
111 state DEFAULT_BORDER:
112 border = 'normal', 'pixel'
113 -> DEFAULT_BORDER_PIXELS
114 border = '1pixel', 'none'
115 -> call cfg_default_border($windowtype, $border, -1)
117 state DEFAULT_BORDER_PIXELS:
119 -> call cfg_default_border($windowtype, $border, 2)
121 -> DEFAULT_BORDER_PIXELS_PX
123 state DEFAULT_BORDER_PIXELS_PX:
127 -> call cfg_default_border($windowtype, $border, &width)
129 # hide_edge_borders <none|vertical|horizontal|both|smart>
130 # also hide_edge_borders <bool> for compatibility
131 state HIDE_EDGE_BORDERS:
132 hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
133 -> call cfg_hide_edge_borders($hide_borders)
134 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
135 -> call cfg_hide_edge_borders($hide_borders)
137 # for_window <criteria> command
140 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
142 state FOR_WINDOW_COMMAND:
144 -> call cfg_for_window($command)
146 # assign <criteria> [→] [workspace | output] <name>
149 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
151 state ASSIGN_WORKSPACE:
159 -> ASSIGN_WORKSPACE_NUMBER
161 -> call cfg_assign($workspace, 0)
165 -> call cfg_assign_output($output)
167 state ASSIGN_WORKSPACE_NUMBER:
169 -> call cfg_assign($number, 1)
171 # no_focus <criteria>
174 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
178 -> call cfg_no_focus()
180 # Criteria: Used by for_window and assign.
182 ctype = 'class' -> CRITERION
183 ctype = 'instance' -> CRITERION
184 ctype = 'window_role' -> CRITERION
185 ctype = 'con_id' -> CRITERION
186 ctype = 'id' -> CRITERION
187 ctype = 'window_type' -> CRITERION
188 ctype = 'con_mark' -> CRITERION
189 ctype = 'title' -> CRITERION
190 ctype = 'urgent' -> CRITERION
191 ctype = 'workspace' -> CRITERION
192 ctype = 'tiling', 'floating'
193 -> call cfg_criteria_add($ctype, NULL); CRITERIA
195 -> call cfg_criteria_pop_state()
202 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
204 # focus_follows_mouse bool
205 state FOCUS_FOLLOWS_MOUSE:
207 -> call cfg_focus_follows_mouse($value)
209 # mouse_warping warping_t
211 value = 'none', 'output'
212 -> call cfg_mouse_warping($value)
215 state FOCUS_WRAPPING:
216 value = '1', 'yes', 'true', 'on', 'enable', 'active', '0', 'no', 'false', 'off', 'disable', 'inactive', 'force'
217 -> call cfg_focus_wrapping($value)
219 # force_focus_wrapping
220 state FORCE_FOCUS_WRAPPING:
222 -> call cfg_force_focus_wrapping($value)
225 state FORCE_XINERAMA:
227 -> call cfg_force_xinerama($value)
230 state DISABLE_RANDR15:
232 -> call cfg_disable_randr15($value)
234 # workspace_back_and_forth
235 state WORKSPACE_BACK_AND_FORTH:
237 -> call cfg_workspace_back_and_forth($value)
240 # fake_outputs (for testcases)
243 -> call cfg_fake_outputs($outputs)
245 # force_display_urgency_hint <timeout> ms
246 state FORCE_DISPLAY_URGENCY_HINT:
248 -> FORCE_DISPLAY_URGENCY_HINT_MS
253 -> call cfg_show_marks($value)
255 state FORCE_DISPLAY_URGENCY_HINT_MS:
259 -> call cfg_force_display_urgency_hint(&duration_ms)
261 # focus_on_window_activation <smart|urgent|focus|none>
262 state FOCUS_ON_WINDOW_ACTIVATION:
264 -> call cfg_focus_on_window_activation($mode)
266 # workspace <workspace> output <output>
271 state WORKSPACE_OUTPUT:
273 -> WORKSPACE_OUTPUT_STR
275 state WORKSPACE_OUTPUT_STR:
277 -> call cfg_workspace($workspace, $output)
282 -> call cfg_ipc_socket($path)
284 # restart_state <path> (for testcases)
287 -> call cfg_restart_state($path)
289 # popup_during_fullscreen
290 state POPUP_DURING_FULLSCREEN:
291 value = 'ignore', 'leave_fullscreen', 'smart'
292 -> call cfg_popup_during_fullscreen($value)
294 # client.background <hexcolor>
297 -> call cfg_color_single($colorclass, $color)
299 # colorclass border background text indicator
304 state COLOR_BACKGROUND:
312 state COLOR_INDICATOR:
314 -> COLOR_CHILD_BORDER
316 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
318 state COLOR_CHILD_BORDER:
320 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
322 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
324 # <exec|exec_always> [--no-startup-id] command
326 no_startup_id = '--no-startup-id'
329 -> call cfg_exec($exectype, $no_startup_id, $command)
334 -> call cfg_font($font)
338 release = '--release'
342 whole_window = '--whole-window'
344 exclude_titlebar = '--exclude-titlebar'
346 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
354 release = '--release'
358 whole_window = '--whole-window'
360 exclude_titlebar = '--exclude-titlebar'
363 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
365 ################################################################################
367 ################################################################################
370 pango_markup = '--pango_markup'
373 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
384 '#' -> MODE_IGNORE_LINE
385 'set' -> MODE_IGNORE_LINE
386 bindtype = 'bindsym', 'bindcode', 'bind'
391 # We ignore comments and 'set' lines (variables).
392 state MODE_IGNORE_LINE:
397 release = '--release'
401 whole_window = '--whole-window'
403 exclude_titlebar = '--exclude-titlebar'
405 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
412 state MODE_BINDCOMMAND:
413 release = '--release'
417 whole_window = '--whole-window'
419 exclude_titlebar = '--exclude-titlebar'
422 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
424 ################################################################################
425 # Bar configuration (i3bar)
426 ################################################################################
432 -> call cfg_bar_start(); BAR
437 '#' -> BAR_IGNORE_LINE
438 'set' -> BAR_IGNORE_LINE
439 'i3bar_command' -> BAR_BAR_COMMAND
440 'status_command' -> BAR_STATUS_COMMAND
441 'socket_path' -> BAR_SOCKET_PATH
443 'hidden_state' -> BAR_HIDDEN_STATE
445 'modifier' -> BAR_MODIFIER
446 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
447 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
448 'bindsym' -> BAR_BINDSYM
449 'position' -> BAR_POSITION
450 'output' -> BAR_OUTPUT
451 'tray_output' -> BAR_TRAY_OUTPUT
452 'tray_padding' -> BAR_TRAY_PADDING
454 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
455 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
456 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
457 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
458 'strip_workspace_name' -> BAR_STRIP_WORKSPACE_NAME
459 'verbose' -> BAR_VERBOSE
460 'colors' -> BAR_COLORS_BRACE
462 -> call cfg_bar_finish(); INITIAL
464 # We ignore comments and 'set' lines (variables).
465 state BAR_IGNORE_LINE:
469 state BAR_BAR_COMMAND:
471 -> call cfg_bar_i3bar_command($command); BAR
473 state BAR_STATUS_COMMAND:
475 -> call cfg_bar_status_command($command); BAR
477 state BAR_SOCKET_PATH:
479 -> call cfg_bar_socket_path($path); BAR
482 mode = 'dock', 'hide', 'invisible'
483 -> call cfg_bar_mode($mode); BAR
485 state BAR_HIDDEN_STATE:
486 hidden_state = 'hide', 'show'
487 -> call cfg_bar_hidden_state($hidden_state); BAR
491 -> call cfg_bar_id($bar_id); BAR
494 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
495 -> call cfg_bar_modifier($modifier); BAR
497 state BAR_WHEEL_UP_CMD:
499 -> call cfg_bar_wheel_up_cmd($command); BAR
501 state BAR_WHEEL_DOWN_CMD:
503 -> call cfg_bar_wheel_down_cmd($command); BAR
506 release = '--release'
509 -> BAR_BINDSYM_COMMAND
511 state BAR_BINDSYM_COMMAND:
512 release = '--release'
515 -> call cfg_bar_bindsym($button, $release, $command); BAR
518 position = 'top', 'bottom'
519 -> call cfg_bar_position($position); BAR
523 -> call cfg_bar_output($output); BAR
525 state BAR_TRAY_OUTPUT:
527 -> call cfg_bar_tray_output($output); BAR
529 state BAR_TRAY_PADDING:
531 -> BAR_TRAY_PADDING_PX
533 state BAR_TRAY_PADDING_PX:
537 -> call cfg_bar_tray_padding(&padding_px); BAR
541 -> call cfg_bar_font($font); BAR
543 state BAR_SEPARATOR_SYMBOL:
545 -> call cfg_bar_separator_symbol($separator); BAR
547 state BAR_BINDING_MODE_INDICATOR:
549 -> call cfg_bar_binding_mode_indicator($value); BAR
551 state BAR_WORKSPACE_BUTTONS:
553 -> call cfg_bar_workspace_buttons($value); BAR
555 state BAR_STRIP_WORKSPACE_NUMBERS:
557 -> call cfg_bar_strip_workspace_numbers($value); BAR
559 state BAR_STRIP_WORKSPACE_NAME:
561 -> call cfg_bar_strip_workspace_name($value); BAR
565 -> call cfg_bar_verbose($value); BAR
567 state BAR_COLORS_BRACE:
575 '#' -> BAR_COLORS_IGNORE_LINE
576 'set' -> BAR_COLORS_IGNORE_LINE
577 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
579 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
584 # We ignore comments and 'set' lines (variables).
585 state BAR_COLORS_IGNORE_LINE:
589 state BAR_COLORS_SINGLE:
591 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
593 state BAR_COLORS_BORDER:
595 -> BAR_COLORS_BACKGROUND
597 state BAR_COLORS_BACKGROUND:
601 state BAR_COLORS_TEXT:
603 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
605 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS