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 -> call cfg_assign($workspace)
157 # no_focus <criteria>
160 -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
164 -> call cfg_no_focus()
166 # Criteria: Used by for_window and assign.
168 ctype = 'class' -> CRITERION
169 ctype = 'instance' -> CRITERION
170 ctype = 'window_role' -> CRITERION
171 ctype = 'con_id' -> CRITERION
172 ctype = 'id' -> CRITERION
173 ctype = 'window_type' -> CRITERION
174 ctype = 'con_mark' -> CRITERION
175 ctype = 'title' -> CRITERION
176 ctype = 'urgent' -> CRITERION
177 ctype = 'workspace' -> CRITERION
178 ctype = 'tiling', 'floating'
179 -> call cfg_criteria_add($ctype, NULL); CRITERIA
181 -> call cfg_criteria_pop_state()
188 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
190 # focus_follows_mouse bool
191 state FOCUS_FOLLOWS_MOUSE:
193 -> call cfg_focus_follows_mouse($value)
195 # mouse_warping warping_t
197 value = 'none', 'output'
198 -> call cfg_mouse_warping($value)
200 # force_focus_wrapping
201 state FORCE_FOCUS_WRAPPING:
203 -> call cfg_force_focus_wrapping($value)
206 state FORCE_XINERAMA:
208 -> call cfg_force_xinerama($value)
211 state DISABLE_RANDR15:
213 -> call cfg_disable_randr15($value)
215 # workspace_back_and_forth
216 state WORKSPACE_BACK_AND_FORTH:
218 -> call cfg_workspace_back_and_forth($value)
221 # fake_outputs (for testcases)
224 -> call cfg_fake_outputs($outputs)
226 # force_display_urgency_hint <timeout> ms
227 state FORCE_DISPLAY_URGENCY_HINT:
229 -> FORCE_DISPLAY_URGENCY_HINT_MS
234 -> call cfg_show_marks($value)
236 state FORCE_DISPLAY_URGENCY_HINT_MS:
240 -> call cfg_force_display_urgency_hint(&duration_ms)
242 # focus_on_window_activation <smart|urgent|focus|none>
243 state FOCUS_ON_WINDOW_ACTIVATION:
245 -> call cfg_focus_on_window_activation($mode)
247 # workspace <workspace> output <output>
252 state WORKSPACE_OUTPUT:
254 -> WORKSPACE_OUTPUT_STR
256 state WORKSPACE_OUTPUT_STR:
258 -> call cfg_workspace($workspace, $output)
263 -> call cfg_ipc_socket($path)
265 # restart_state <path> (for testcases)
268 -> call cfg_restart_state($path)
270 # popup_during_fullscreen
271 state POPUP_DURING_FULLSCREEN:
272 value = 'ignore', 'leave_fullscreen', 'smart'
273 -> call cfg_popup_during_fullscreen($value)
275 # client.background <hexcolor>
278 -> call cfg_color_single($colorclass, $color)
280 # colorclass border background text indicator
285 state COLOR_BACKGROUND:
293 state COLOR_INDICATOR:
295 -> COLOR_CHILD_BORDER
297 -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
299 state COLOR_CHILD_BORDER:
301 -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
303 -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
305 # <exec|exec_always> [--no-startup-id] command
307 no_startup_id = '--no-startup-id'
310 -> call cfg_exec($exectype, $no_startup_id, $command)
315 -> call cfg_font($font)
319 release = '--release'
323 whole_window = '--whole-window'
325 exclude_titlebar = '--exclude-titlebar'
327 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
335 release = '--release'
339 whole_window = '--whole-window'
341 exclude_titlebar = '--exclude-titlebar'
344 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
346 ################################################################################
348 ################################################################################
351 pango_markup = '--pango_markup'
354 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
365 '#' -> MODE_IGNORE_LINE
366 'set' -> MODE_IGNORE_LINE
367 bindtype = 'bindsym', 'bindcode', 'bind'
372 # We ignore comments and 'set' lines (variables).
373 state MODE_IGNORE_LINE:
378 release = '--release'
382 whole_window = '--whole-window'
384 exclude_titlebar = '--exclude-titlebar'
386 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
393 state MODE_BINDCOMMAND:
394 release = '--release'
398 whole_window = '--whole-window'
400 exclude_titlebar = '--exclude-titlebar'
403 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
405 ################################################################################
406 # Bar configuration (i3bar)
407 ################################################################################
413 -> call cfg_bar_start(); BAR
418 '#' -> BAR_IGNORE_LINE
419 'set' -> BAR_IGNORE_LINE
420 'i3bar_command' -> BAR_BAR_COMMAND
421 'status_command' -> BAR_STATUS_COMMAND
422 'socket_path' -> BAR_SOCKET_PATH
424 'hidden_state' -> BAR_HIDDEN_STATE
426 'modifier' -> BAR_MODIFIER
427 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
428 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
429 'bindsym' -> BAR_BINDSYM
430 'position' -> BAR_POSITION
431 'output' -> BAR_OUTPUT
432 'tray_output' -> BAR_TRAY_OUTPUT
433 'tray_padding' -> BAR_TRAY_PADDING
435 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
436 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
437 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
438 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
439 'verbose' -> BAR_VERBOSE
440 'colors' -> BAR_COLORS_BRACE
442 -> call cfg_bar_finish(); INITIAL
444 # We ignore comments and 'set' lines (variables).
445 state BAR_IGNORE_LINE:
449 state BAR_BAR_COMMAND:
451 -> call cfg_bar_i3bar_command($command); BAR
453 state BAR_STATUS_COMMAND:
455 -> call cfg_bar_status_command($command); BAR
457 state BAR_SOCKET_PATH:
459 -> call cfg_bar_socket_path($path); BAR
462 mode = 'dock', 'hide', 'invisible'
463 -> call cfg_bar_mode($mode); BAR
465 state BAR_HIDDEN_STATE:
466 hidden_state = 'hide', 'show'
467 -> call cfg_bar_hidden_state($hidden_state); BAR
471 -> call cfg_bar_id($bar_id); BAR
474 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
475 -> call cfg_bar_modifier($modifier); BAR
477 state BAR_WHEEL_UP_CMD:
479 -> call cfg_bar_wheel_up_cmd($command); BAR
481 state BAR_WHEEL_DOWN_CMD:
483 -> call cfg_bar_wheel_down_cmd($command); BAR
487 -> BAR_BINDSYM_COMMAND
489 state BAR_BINDSYM_COMMAND:
491 -> call cfg_bar_bindsym($button, $command); BAR
494 position = 'top', 'bottom'
495 -> call cfg_bar_position($position); BAR
499 -> call cfg_bar_output($output); BAR
501 state BAR_TRAY_OUTPUT:
503 -> call cfg_bar_tray_output($output); BAR
505 state BAR_TRAY_PADDING:
507 -> BAR_TRAY_PADDING_PX
509 state BAR_TRAY_PADDING_PX:
513 -> call cfg_bar_tray_padding(&padding_px); BAR
517 -> call cfg_bar_font($font); BAR
519 state BAR_SEPARATOR_SYMBOL:
521 -> call cfg_bar_separator_symbol($separator); BAR
523 state BAR_BINDING_MODE_INDICATOR:
525 -> call cfg_bar_binding_mode_indicator($value); BAR
527 state BAR_WORKSPACE_BUTTONS:
529 -> call cfg_bar_workspace_buttons($value); BAR
531 state BAR_STRIP_WORKSPACE_NUMBERS:
533 -> call cfg_bar_strip_workspace_numbers($value); BAR
537 -> call cfg_bar_verbose($value); BAR
539 state BAR_COLORS_BRACE:
547 '#' -> BAR_COLORS_IGNORE_LINE
548 'set' -> BAR_COLORS_IGNORE_LINE
549 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
551 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
556 # We ignore comments and 'set' lines (variables).
557 state BAR_COLORS_IGNORE_LINE:
561 state BAR_COLORS_SINGLE:
563 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
565 state BAR_COLORS_BORDER:
567 -> BAR_COLORS_BACKGROUND
569 state BAR_COLORS_BACKGROUND:
573 state BAR_COLORS_TEXT:
575 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
577 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS