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:
152 -> call cfg_assign($workspace)
154 # no_focus <criteria>
157 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
161 -> call cfg_no_focus()
163 # Criteria: Used by for_window and assign.
165 ctype = 'class' -> CRITERION
166 ctype = 'instance' -> CRITERION
167 ctype = 'window_role' -> CRITERION
168 ctype = 'con_id' -> CRITERION
169 ctype = 'id' -> CRITERION
170 ctype = 'window_type' -> CRITERION
171 ctype = 'con_mark' -> CRITERION
172 ctype = 'title' -> CRITERION
173 ctype = 'urgent' -> CRITERION
174 ctype = 'workspace' -> CRITERION
176 -> call cfg_criteria_pop_state()
183 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
185 # focus_follows_mouse bool
186 state FOCUS_FOLLOWS_MOUSE:
188 -> call cfg_focus_follows_mouse($value)
190 # mouse_warping warping_t
192 value = 'none', 'output'
193 -> call cfg_mouse_warping($value)
195 # force_focus_wrapping
196 state FORCE_FOCUS_WRAPPING:
198 -> call cfg_force_focus_wrapping($value)
201 state FORCE_XINERAMA:
203 -> call cfg_force_xinerama($value)
205 # workspace_back_and_forth
206 state WORKSPACE_BACK_AND_FORTH:
208 -> call cfg_workspace_back_and_forth($value)
211 # fake_outputs (for testcases)
214 -> call cfg_fake_outputs($outputs)
216 # force_display_urgency_hint <timeout> ms
217 state FORCE_DISPLAY_URGENCY_HINT:
219 -> FORCE_DISPLAY_URGENCY_HINT_MS
224 -> call cfg_show_marks($value)
226 state FORCE_DISPLAY_URGENCY_HINT_MS:
230 -> call cfg_force_display_urgency_hint(&duration_ms)
232 # focus_on_window_activation <smart|urgent|focus|none>
233 state FOCUS_ON_WINDOW_ACTIVATION:
235 -> call cfg_focus_on_window_activation($mode)
237 # workspace <workspace> output <output>
242 state WORKSPACE_OUTPUT:
244 -> WORKSPACE_OUTPUT_STR
246 state WORKSPACE_OUTPUT_STR:
248 -> call cfg_workspace($workspace, $output)
253 -> call cfg_ipc_socket($path)
255 # restart_state <path> (for testcases)
258 -> call cfg_restart_state($path)
260 # popup_during_fullscreen
261 state POPUP_DURING_FULLSCREEN:
262 value = 'ignore', 'leave_fullscreen', 'smart'
263 -> call cfg_popup_during_fullscreen($value)
265 # client.background <hexcolor>
268 -> call cfg_color_single($colorclass, $color)
270 # colorclass border background text indicator
275 state COLOR_BACKGROUND:
283 state COLOR_INDICATOR:
285 -> COLOR_CHILD_BORDER
287 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
289 state COLOR_CHILD_BORDER:
291 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
293 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
295 # <exec|exec_always> [--no-startup-id] command
297 no_startup_id = '--no-startup-id'
300 -> call cfg_exec($exectype, $no_startup_id, $command)
305 -> call cfg_font($font)
309 release = '--release'
313 whole_window = '--whole-window'
315 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
323 release = '--release'
327 whole_window = '--whole-window'
330 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command)
332 ################################################################################
334 ################################################################################
337 pango_markup = '--pango_markup'
340 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
351 '#' -> MODE_IGNORE_LINE
352 'set' -> MODE_IGNORE_LINE
353 bindtype = 'bindsym', 'bindcode', 'bind'
358 # We ignore comments and 'set' lines (variables).
359 state MODE_IGNORE_LINE:
364 release = '--release'
368 whole_window = '--whole-window'
370 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
377 state MODE_BINDCOMMAND:
378 release = '--release'
382 whole_window = '--whole-window'
385 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command); MODE
387 ################################################################################
388 # Bar configuration (i3bar)
389 ################################################################################
395 -> call cfg_bar_start(); BAR
400 '#' -> BAR_IGNORE_LINE
401 'set' -> BAR_IGNORE_LINE
402 'i3bar_command' -> BAR_BAR_COMMAND
403 'status_command' -> BAR_STATUS_COMMAND
404 'socket_path' -> BAR_SOCKET_PATH
406 'hidden_state' -> BAR_HIDDEN_STATE
408 'modifier' -> BAR_MODIFIER
409 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
410 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
411 'bindsym' -> BAR_BINDSYM
412 'position' -> BAR_POSITION
413 'output' -> BAR_OUTPUT
414 'tray_output' -> BAR_TRAY_OUTPUT
415 'tray_padding' -> BAR_TRAY_PADDING
417 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
418 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
419 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
420 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
421 'verbose' -> BAR_VERBOSE
422 'colors' -> BAR_COLORS_BRACE
424 -> call cfg_bar_finish(); INITIAL
426 # We ignore comments and 'set' lines (variables).
427 state BAR_IGNORE_LINE:
431 state BAR_BAR_COMMAND:
433 -> call cfg_bar_i3bar_command($command); BAR
435 state BAR_STATUS_COMMAND:
437 -> call cfg_bar_status_command($command); BAR
439 state BAR_SOCKET_PATH:
441 -> call cfg_bar_socket_path($path); BAR
444 mode = 'dock', 'hide', 'invisible'
445 -> call cfg_bar_mode($mode); BAR
447 state BAR_HIDDEN_STATE:
448 hidden_state = 'hide', 'show'
449 -> call cfg_bar_hidden_state($hidden_state); BAR
453 -> call cfg_bar_id($bar_id); BAR
456 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
457 -> call cfg_bar_modifier($modifier); BAR
459 state BAR_WHEEL_UP_CMD:
461 -> call cfg_bar_wheel_up_cmd($command); BAR
463 state BAR_WHEEL_DOWN_CMD:
465 -> call cfg_bar_wheel_down_cmd($command); BAR
469 -> BAR_BINDSYM_COMMAND
471 state BAR_BINDSYM_COMMAND:
473 -> call cfg_bar_bindsym($button, $command); BAR
476 position = 'top', 'bottom'
477 -> call cfg_bar_position($position); BAR
481 -> call cfg_bar_output($output); BAR
483 state BAR_TRAY_OUTPUT:
485 -> call cfg_bar_tray_output($output); BAR
487 state BAR_TRAY_PADDING:
489 -> BAR_TRAY_PADDING_PX
491 state BAR_TRAY_PADDING_PX:
495 -> call cfg_bar_tray_padding(&padding_px); BAR
499 -> call cfg_bar_font($font); BAR
501 state BAR_SEPARATOR_SYMBOL:
503 -> call cfg_bar_separator_symbol($separator); BAR
505 state BAR_BINDING_MODE_INDICATOR:
507 -> call cfg_bar_binding_mode_indicator($value); BAR
509 state BAR_WORKSPACE_BUTTONS:
511 -> call cfg_bar_workspace_buttons($value); BAR
513 state BAR_STRIP_WORKSPACE_NUMBERS:
515 -> call cfg_bar_strip_workspace_numbers($value); BAR
519 -> call cfg_bar_verbose($value); BAR
521 state BAR_COLORS_BRACE:
529 '#' -> BAR_COLORS_IGNORE_LINE
530 'set' -> BAR_COLORS_IGNORE_LINE
531 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
533 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
538 # We ignore comments and 'set' lines (variables).
539 state BAR_COLORS_IGNORE_LINE:
543 state BAR_COLORS_SINGLE:
545 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
547 state BAR_COLORS_BORDER:
549 -> BAR_COLORS_BACKGROUND
551 state BAR_COLORS_BACKGROUND:
555 state BAR_COLORS_TEXT:
557 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
559 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS