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 bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
25 'floating_minimum_size' -> FLOATING_MINIMUM_SIZE_WIDTH
26 'floating_maximum_size' -> FLOATING_MAXIMUM_SIZE_WIDTH
27 'floating_modifier' -> FLOATING_MODIFIER
28 'default_orientation' -> DEFAULT_ORIENTATION
29 'workspace_layout' -> WORKSPACE_LAYOUT
30 windowtype = 'new_window', 'new_float' -> NEW_WINDOW
31 'hide_edge_borders' -> HIDE_EDGE_BORDERS
32 'for_window' -> FOR_WINDOW
34 'no_focus' -> NO_FOCUS
35 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
36 'mouse_warping' -> MOUSE_WARPING
37 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
38 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
39 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
40 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
41 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
42 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
43 'show_marks' -> SHOW_MARKS
44 'workspace' -> WORKSPACE
45 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
46 'restart_state' -> RESTART_STATE
47 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
48 exectype = 'exec_always', 'exec' -> EXEC
49 colorclass = 'client.background'
51 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
54 # We ignore comments and 'set' lines (variables).
59 # floating_minimum_size <width> x <height>
60 state FLOATING_MINIMUM_SIZE_WIDTH:
62 -> FLOATING_MINIMUM_SIZE_X
64 state FLOATING_MINIMUM_SIZE_X:
66 -> FLOATING_MINIMUM_SIZE_HEIGHT
68 state FLOATING_MINIMUM_SIZE_HEIGHT:
70 -> call cfg_floating_minimum_size(&width, &height)
72 # floating_maximum_size <width> x <height>
73 state FLOATING_MAXIMUM_SIZE_WIDTH:
75 -> FLOATING_MAXIMUM_SIZE_X
77 state FLOATING_MAXIMUM_SIZE_X:
79 -> FLOATING_MAXIMUM_SIZE_HEIGHT
81 state FLOATING_MAXIMUM_SIZE_HEIGHT:
83 -> call cfg_floating_maximum_size(&width, &height)
85 # floating_modifier <modifier>
86 state FLOATING_MODIFIER:
87 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
92 -> call cfg_floating_modifier($modifiers)
94 # default_orientation <horizontal|vertical|auto>
95 state DEFAULT_ORIENTATION:
96 orientation = 'horizontal', 'vertical', 'auto'
97 -> call cfg_default_orientation($orientation)
99 # workspace_layout <default|stacking|tabbed>
100 state WORKSPACE_LAYOUT:
101 layout = 'default', 'stacking', 'stacked', 'tabbed'
102 -> call cfg_workspace_layout($layout)
104 # new_window <normal|1pixel|none>
105 # new_float <normal|1pixel|none>
107 border = 'normal', 'pixel'
109 border = '1pixel', 'none'
110 -> call cfg_new_window($windowtype, $border, -1)
112 state NEW_WINDOW_PIXELS:
114 -> call cfg_new_window($windowtype, $border, 2)
116 -> NEW_WINDOW_PIXELS_PX
118 state NEW_WINDOW_PIXELS_PX:
122 -> call cfg_new_window($windowtype, $border, &width)
124 # hide_edge_borders <none|vertical|horizontal|both>
125 # also hide_edge_borders <bool> for compatibility
126 state HIDE_EDGE_BORDERS:
127 hide_borders = 'none', 'vertical', 'horizontal', 'both'
128 -> call cfg_hide_edge_borders($hide_borders)
129 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
130 -> call cfg_hide_edge_borders($hide_borders)
132 # for_window <criteria> command
135 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
137 state FOR_WINDOW_COMMAND:
139 -> call cfg_for_window($command)
141 # assign <criteria> [→] workspace
144 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
146 state ASSIGN_WORKSPACE:
150 -> call cfg_assign($workspace)
152 # no_focus <criteria>
155 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
159 -> call cfg_no_focus()
161 # Criteria: Used by for_window and assign.
163 ctype = 'class' -> CRITERION
164 ctype = 'instance' -> CRITERION
165 ctype = 'window_role' -> CRITERION
166 ctype = 'con_id' -> CRITERION
167 ctype = 'id' -> CRITERION
168 ctype = 'window_type' -> CRITERION
169 ctype = 'con_mark' -> CRITERION
170 ctype = 'title' -> CRITERION
171 ctype = 'urgent' -> CRITERION
172 ctype = 'workspace' -> CRITERION
174 -> call cfg_criteria_pop_state()
181 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
183 # focus_follows_mouse bool
184 state FOCUS_FOLLOWS_MOUSE:
186 -> call cfg_focus_follows_mouse($value)
188 # mouse_warping warping_t
190 value = 'none', 'output'
191 -> call cfg_mouse_warping($value)
193 # force_focus_wrapping
194 state FORCE_FOCUS_WRAPPING:
196 -> call cfg_force_focus_wrapping($value)
199 state FORCE_XINERAMA:
201 -> call cfg_force_xinerama($value)
203 # workspace_back_and_forth
204 state WORKSPACE_BACK_AND_FORTH:
206 -> call cfg_workspace_back_and_forth($value)
209 # fake_outputs (for testcases)
212 -> call cfg_fake_outputs($outputs)
214 # force_display_urgency_hint <timeout> ms
215 state FORCE_DISPLAY_URGENCY_HINT:
217 -> FORCE_DISPLAY_URGENCY_HINT_MS
222 -> call cfg_show_marks($value)
224 state FORCE_DISPLAY_URGENCY_HINT_MS:
228 -> call cfg_force_display_urgency_hint(&duration_ms)
230 # focus_on_window_activation <smart|urgent|focus|none>
231 state FOCUS_ON_WINDOW_ACTIVATION:
233 -> call cfg_focus_on_window_activation($mode)
235 # workspace <workspace> output <output>
240 state WORKSPACE_OUTPUT:
242 -> WORKSPACE_OUTPUT_STR
244 state WORKSPACE_OUTPUT_STR:
246 -> call cfg_workspace($workspace, $output)
251 -> call cfg_ipc_socket($path)
253 # restart_state <path> (for testcases)
256 -> call cfg_restart_state($path)
258 # popup_during_fullscreen
259 state POPUP_DURING_FULLSCREEN:
260 value = 'ignore', 'leave_fullscreen', 'smart'
261 -> call cfg_popup_during_fullscreen($value)
263 # client.background <hexcolor>
266 -> call cfg_color_single($colorclass, $color)
268 # colorclass border background text indicator
273 state COLOR_BACKGROUND:
281 state COLOR_INDICATOR:
283 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
285 -> call cfg_color($colorclass, $border, $background, $text, NULL)
287 # <exec|exec_always> [--no-startup-id] command
289 no_startup_id = '--no-startup-id'
292 -> call cfg_exec($exectype, $no_startup_id, $command)
297 -> call cfg_font($font)
301 release = '--release'
305 whole_window = '--whole-window'
307 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
315 release = '--release'
319 whole_window = '--whole-window'
322 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command)
324 ################################################################################
326 ################################################################################
329 pango_markup = '--pango_markup'
332 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
343 '#' -> MODE_IGNORE_LINE
344 'set' -> MODE_IGNORE_LINE
345 bindtype = 'bindsym', 'bindcode', 'bind'
350 # We ignore comments and 'set' lines (variables).
351 state MODE_IGNORE_LINE:
356 release = '--release'
360 whole_window = '--whole-window'
362 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
369 state MODE_BINDCOMMAND:
370 release = '--release'
374 whole_window = '--whole-window'
377 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command); MODE
379 ################################################################################
380 # Bar configuration (i3bar)
381 ################################################################################
387 -> call cfg_bar_start(); BAR
392 '#' -> BAR_IGNORE_LINE
393 'set' -> BAR_IGNORE_LINE
394 'i3bar_command' -> BAR_BAR_COMMAND
395 'status_command' -> BAR_STATUS_COMMAND
396 'socket_path' -> BAR_SOCKET_PATH
398 'hidden_state' -> BAR_HIDDEN_STATE
400 'modifier' -> BAR_MODIFIER
401 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
402 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
403 'bindsym' -> BAR_BINDSYM
404 'position' -> BAR_POSITION
405 'output' -> BAR_OUTPUT
406 'tray_output' -> BAR_TRAY_OUTPUT
407 'tray_padding' -> BAR_TRAY_PADDING
409 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
410 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
411 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
412 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
413 'verbose' -> BAR_VERBOSE
414 'colors' -> BAR_COLORS_BRACE
416 -> call cfg_bar_finish(); INITIAL
418 # We ignore comments and 'set' lines (variables).
419 state BAR_IGNORE_LINE:
423 state BAR_BAR_COMMAND:
425 -> call cfg_bar_i3bar_command($command); BAR
427 state BAR_STATUS_COMMAND:
429 -> call cfg_bar_status_command($command); BAR
431 state BAR_SOCKET_PATH:
433 -> call cfg_bar_socket_path($path); BAR
436 mode = 'dock', 'hide', 'invisible'
437 -> call cfg_bar_mode($mode); BAR
439 state BAR_HIDDEN_STATE:
440 hidden_state = 'hide', 'show'
441 -> call cfg_bar_hidden_state($hidden_state); BAR
445 -> call cfg_bar_id($bar_id); BAR
448 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
449 -> call cfg_bar_modifier($modifier); BAR
451 state BAR_WHEEL_UP_CMD:
453 -> call cfg_bar_wheel_up_cmd($command); BAR
455 state BAR_WHEEL_DOWN_CMD:
457 -> call cfg_bar_wheel_down_cmd($command); BAR
461 -> BAR_BINDSYM_COMMAND
463 state BAR_BINDSYM_COMMAND:
465 -> call cfg_bar_bindsym($button, $command); BAR
468 position = 'top', 'bottom'
469 -> call cfg_bar_position($position); BAR
473 -> call cfg_bar_output($output); BAR
475 state BAR_TRAY_OUTPUT:
477 -> call cfg_bar_tray_output($output); BAR
479 state BAR_TRAY_PADDING:
481 -> BAR_TRAY_PADDING_PX
483 state BAR_TRAY_PADDING_PX:
487 -> call cfg_bar_tray_padding(&padding_px); BAR
491 -> call cfg_bar_font($font); BAR
493 state BAR_SEPARATOR_SYMBOL:
495 -> call cfg_bar_separator_symbol($separator); BAR
497 state BAR_BINDING_MODE_INDICATOR:
499 -> call cfg_bar_binding_mode_indicator($value); BAR
501 state BAR_WORKSPACE_BUTTONS:
503 -> call cfg_bar_workspace_buttons($value); BAR
505 state BAR_STRIP_WORKSPACE_NUMBERS:
507 -> call cfg_bar_strip_workspace_numbers($value); BAR
511 -> call cfg_bar_verbose($value); BAR
513 state BAR_COLORS_BRACE:
521 '#' -> BAR_COLORS_IGNORE_LINE
522 'set' -> BAR_COLORS_IGNORE_LINE
523 colorclass = 'background', 'statusline', 'separator'
525 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
530 # We ignore comments and 'set' lines (variables).
531 state BAR_COLORS_IGNORE_LINE:
535 state BAR_COLORS_SINGLE:
537 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
539 state BAR_COLORS_BORDER:
541 -> BAR_COLORS_BACKGROUND
543 state BAR_COLORS_BACKGROUND:
547 state BAR_COLORS_TEXT:
549 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
551 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS