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 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
40 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
41 'disable_randr15', 'disable-randr15' -> DISABLE_RANDR15
42 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
43 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
44 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
45 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
46 'show_marks' -> SHOW_MARKS
47 'workspace' -> WORKSPACE
48 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
49 'restart_state' -> RESTART_STATE
50 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
51 exectype = 'exec_always', 'exec' -> EXEC
52 colorclass = 'client.background'
54 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
57 # We ignore comments and 'set' lines (variables).
62 # floating_minimum_size <width> x <height>
63 state FLOATING_MINIMUM_SIZE_WIDTH:
65 -> FLOATING_MINIMUM_SIZE_X
67 state FLOATING_MINIMUM_SIZE_X:
69 -> FLOATING_MINIMUM_SIZE_HEIGHT
71 state FLOATING_MINIMUM_SIZE_HEIGHT:
73 -> call cfg_floating_minimum_size(&width, &height)
75 # floating_maximum_size <width> x <height>
76 state FLOATING_MAXIMUM_SIZE_WIDTH:
78 -> FLOATING_MAXIMUM_SIZE_X
80 state FLOATING_MAXIMUM_SIZE_X:
82 -> FLOATING_MAXIMUM_SIZE_HEIGHT
84 state FLOATING_MAXIMUM_SIZE_HEIGHT:
86 -> call cfg_floating_maximum_size(&width, &height)
88 # floating_modifier <modifier>
89 state FLOATING_MODIFIER:
90 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
95 -> call cfg_floating_modifier($modifiers)
97 # default_orientation <horizontal|vertical|auto>
98 state DEFAULT_ORIENTATION:
99 orientation = 'horizontal', 'vertical', 'auto'
100 -> call cfg_default_orientation($orientation)
102 # workspace_layout <default|stacking|tabbed>
103 state WORKSPACE_LAYOUT:
104 layout = 'default', 'stacking', 'stacked', 'tabbed'
105 -> call cfg_workspace_layout($layout)
107 # new_window <normal|1pixel|none>
108 # new_float <normal|1pixel|none>
110 border = 'normal', 'pixel'
112 border = '1pixel', 'none'
113 -> call cfg_new_window($windowtype, $border, -1)
115 state NEW_WINDOW_PIXELS:
117 -> call cfg_new_window($windowtype, $border, 2)
119 -> NEW_WINDOW_PIXELS_PX
121 state NEW_WINDOW_PIXELS_PX:
125 -> call cfg_new_window($windowtype, $border, &width)
127 # hide_edge_borders <none|vertical|horizontal|both|smart>
128 # also hide_edge_borders <bool> for compatibility
129 state HIDE_EDGE_BORDERS:
130 hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
131 -> call cfg_hide_edge_borders($hide_borders)
132 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
133 -> call cfg_hide_edge_borders($hide_borders)
135 # for_window <criteria> command
138 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
140 state FOR_WINDOW_COMMAND:
142 -> call cfg_for_window($command)
144 # assign <criteria> [→] workspace
147 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
149 state ASSIGN_WORKSPACE:
155 -> ASSIGN_WORKSPACE_NUMBER
157 -> call cfg_assign($workspace, 0)
159 state ASSIGN_WORKSPACE_NUMBER:
161 -> call cfg_assign($number, 1)
163 # no_focus <criteria>
166 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
170 -> call cfg_no_focus()
172 # Criteria: Used by for_window and assign.
174 ctype = 'class' -> CRITERION
175 ctype = 'instance' -> CRITERION
176 ctype = 'window_role' -> CRITERION
177 ctype = 'con_id' -> CRITERION
178 ctype = 'id' -> CRITERION
179 ctype = 'window_type' -> CRITERION
180 ctype = 'con_mark' -> CRITERION
181 ctype = 'title' -> CRITERION
182 ctype = 'urgent' -> CRITERION
183 ctype = 'workspace' -> CRITERION
184 ctype = 'tiling', 'floating'
185 -> call cfg_criteria_add($ctype, NULL); CRITERIA
187 -> call cfg_criteria_pop_state()
194 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
196 # focus_follows_mouse bool
197 state FOCUS_FOLLOWS_MOUSE:
199 -> call cfg_focus_follows_mouse($value)
201 # mouse_warping warping_t
203 value = 'none', 'output'
204 -> call cfg_mouse_warping($value)
206 # force_focus_wrapping
207 state FORCE_FOCUS_WRAPPING:
209 -> call cfg_force_focus_wrapping($value)
212 state FORCE_XINERAMA:
214 -> call cfg_force_xinerama($value)
217 state DISABLE_RANDR15:
219 -> call cfg_disable_randr15($value)
221 # workspace_back_and_forth
222 state WORKSPACE_BACK_AND_FORTH:
224 -> call cfg_workspace_back_and_forth($value)
227 # fake_outputs (for testcases)
230 -> call cfg_fake_outputs($outputs)
232 # force_display_urgency_hint <timeout> ms
233 state FORCE_DISPLAY_URGENCY_HINT:
235 -> FORCE_DISPLAY_URGENCY_HINT_MS
240 -> call cfg_show_marks($value)
242 state FORCE_DISPLAY_URGENCY_HINT_MS:
246 -> call cfg_force_display_urgency_hint(&duration_ms)
248 # focus_on_window_activation <smart|urgent|focus|none>
249 state FOCUS_ON_WINDOW_ACTIVATION:
251 -> call cfg_focus_on_window_activation($mode)
253 # workspace <workspace> output <output>
258 state WORKSPACE_OUTPUT:
260 -> WORKSPACE_OUTPUT_STR
262 state WORKSPACE_OUTPUT_STR:
264 -> call cfg_workspace($workspace, $output)
269 -> call cfg_ipc_socket($path)
271 # restart_state <path> (for testcases)
274 -> call cfg_restart_state($path)
276 # popup_during_fullscreen
277 state POPUP_DURING_FULLSCREEN:
278 value = 'ignore', 'leave_fullscreen', 'smart'
279 -> call cfg_popup_during_fullscreen($value)
281 # client.background <hexcolor>
284 -> call cfg_color_single($colorclass, $color)
286 # colorclass border background text indicator
291 state COLOR_BACKGROUND:
299 state COLOR_INDICATOR:
301 -> COLOR_CHILD_BORDER
303 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
305 state COLOR_CHILD_BORDER:
307 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
309 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
311 # <exec|exec_always> [--no-startup-id] command
313 no_startup_id = '--no-startup-id'
316 -> call cfg_exec($exectype, $no_startup_id, $command)
321 -> call cfg_font($font)
325 release = '--release'
329 whole_window = '--whole-window'
331 exclude_titlebar = '--exclude-titlebar'
333 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
341 release = '--release'
345 whole_window = '--whole-window'
347 exclude_titlebar = '--exclude-titlebar'
350 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
352 ################################################################################
354 ################################################################################
357 pango_markup = '--pango_markup'
360 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
371 '#' -> MODE_IGNORE_LINE
372 'set' -> MODE_IGNORE_LINE
373 bindtype = 'bindsym', 'bindcode', 'bind'
378 # We ignore comments and 'set' lines (variables).
379 state MODE_IGNORE_LINE:
384 release = '--release'
388 whole_window = '--whole-window'
390 exclude_titlebar = '--exclude-titlebar'
392 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
399 state MODE_BINDCOMMAND:
400 release = '--release'
404 whole_window = '--whole-window'
406 exclude_titlebar = '--exclude-titlebar'
409 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
411 ################################################################################
412 # Bar configuration (i3bar)
413 ################################################################################
419 -> call cfg_bar_start(); BAR
424 '#' -> BAR_IGNORE_LINE
425 'set' -> BAR_IGNORE_LINE
426 'i3bar_command' -> BAR_BAR_COMMAND
427 'status_command' -> BAR_STATUS_COMMAND
428 'socket_path' -> BAR_SOCKET_PATH
430 'hidden_state' -> BAR_HIDDEN_STATE
432 'modifier' -> BAR_MODIFIER
433 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
434 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
435 'bindsym' -> BAR_BINDSYM
436 'position' -> BAR_POSITION
437 'output' -> BAR_OUTPUT
438 'tray_output' -> BAR_TRAY_OUTPUT
439 'tray_padding' -> BAR_TRAY_PADDING
441 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
442 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
443 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
444 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
445 'verbose' -> BAR_VERBOSE
446 'colors' -> BAR_COLORS_BRACE
448 -> call cfg_bar_finish(); INITIAL
450 # We ignore comments and 'set' lines (variables).
451 state BAR_IGNORE_LINE:
455 state BAR_BAR_COMMAND:
457 -> call cfg_bar_i3bar_command($command); BAR
459 state BAR_STATUS_COMMAND:
461 -> call cfg_bar_status_command($command); BAR
463 state BAR_SOCKET_PATH:
465 -> call cfg_bar_socket_path($path); BAR
468 mode = 'dock', 'hide', 'invisible'
469 -> call cfg_bar_mode($mode); BAR
471 state BAR_HIDDEN_STATE:
472 hidden_state = 'hide', 'show'
473 -> call cfg_bar_hidden_state($hidden_state); BAR
477 -> call cfg_bar_id($bar_id); BAR
480 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
481 -> call cfg_bar_modifier($modifier); BAR
483 state BAR_WHEEL_UP_CMD:
485 -> call cfg_bar_wheel_up_cmd($command); BAR
487 state BAR_WHEEL_DOWN_CMD:
489 -> call cfg_bar_wheel_down_cmd($command); BAR
493 -> BAR_BINDSYM_COMMAND
495 state BAR_BINDSYM_COMMAND:
497 -> call cfg_bar_bindsym($button, $command); BAR
500 position = 'top', 'bottom'
501 -> call cfg_bar_position($position); BAR
505 -> call cfg_bar_output($output); BAR
507 state BAR_TRAY_OUTPUT:
509 -> call cfg_bar_tray_output($output); BAR
511 state BAR_TRAY_PADDING:
513 -> BAR_TRAY_PADDING_PX
515 state BAR_TRAY_PADDING_PX:
519 -> call cfg_bar_tray_padding(&padding_px); BAR
523 -> call cfg_bar_font($font); BAR
525 state BAR_SEPARATOR_SYMBOL:
527 -> call cfg_bar_separator_symbol($separator); BAR
529 state BAR_BINDING_MODE_INDICATOR:
531 -> call cfg_bar_binding_mode_indicator($value); BAR
533 state BAR_WORKSPACE_BUTTONS:
535 -> call cfg_bar_workspace_buttons($value); BAR
537 state BAR_STRIP_WORKSPACE_NUMBERS:
539 -> call cfg_bar_strip_workspace_numbers($value); BAR
543 -> call cfg_bar_verbose($value); BAR
545 state BAR_COLORS_BRACE:
553 '#' -> BAR_COLORS_IGNORE_LINE
554 'set' -> BAR_COLORS_IGNORE_LINE
555 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
557 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
562 # We ignore comments and 'set' lines (variables).
563 state BAR_COLORS_IGNORE_LINE:
567 state BAR_COLORS_SINGLE:
569 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
571 state BAR_COLORS_BORDER:
573 -> BAR_COLORS_BACKGROUND
575 state BAR_COLORS_BACKGROUND:
579 state BAR_COLORS_TEXT:
581 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
583 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS