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 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
287 -> call cfg_color($colorclass, $border, $background, $text, NULL)
289 # <exec|exec_always> [--no-startup-id] command
291 no_startup_id = '--no-startup-id'
294 -> call cfg_exec($exectype, $no_startup_id, $command)
299 -> call cfg_font($font)
303 release = '--release'
307 whole_window = '--whole-window'
309 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
317 release = '--release'
321 whole_window = '--whole-window'
324 -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command)
326 ################################################################################
328 ################################################################################
331 pango_markup = '--pango_markup'
334 -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
345 '#' -> MODE_IGNORE_LINE
346 'set' -> MODE_IGNORE_LINE
347 bindtype = 'bindsym', 'bindcode', 'bind'
352 # We ignore comments and 'set' lines (variables).
353 state MODE_IGNORE_LINE:
358 release = '--release'
362 whole_window = '--whole-window'
364 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
371 state MODE_BINDCOMMAND:
372 release = '--release'
376 whole_window = '--whole-window'
379 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command); MODE
381 ################################################################################
382 # Bar configuration (i3bar)
383 ################################################################################
389 -> call cfg_bar_start(); BAR
394 '#' -> BAR_IGNORE_LINE
395 'set' -> BAR_IGNORE_LINE
396 'i3bar_command' -> BAR_BAR_COMMAND
397 'status_command' -> BAR_STATUS_COMMAND
398 'socket_path' -> BAR_SOCKET_PATH
400 'hidden_state' -> BAR_HIDDEN_STATE
402 'modifier' -> BAR_MODIFIER
403 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
404 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
405 'bindsym' -> BAR_BINDSYM
406 'position' -> BAR_POSITION
407 'output' -> BAR_OUTPUT
408 'tray_output' -> BAR_TRAY_OUTPUT
409 'tray_padding' -> BAR_TRAY_PADDING
411 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
412 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
413 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
414 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
415 'verbose' -> BAR_VERBOSE
416 'colors' -> BAR_COLORS_BRACE
418 -> call cfg_bar_finish(); INITIAL
420 # We ignore comments and 'set' lines (variables).
421 state BAR_IGNORE_LINE:
425 state BAR_BAR_COMMAND:
427 -> call cfg_bar_i3bar_command($command); BAR
429 state BAR_STATUS_COMMAND:
431 -> call cfg_bar_status_command($command); BAR
433 state BAR_SOCKET_PATH:
435 -> call cfg_bar_socket_path($path); BAR
438 mode = 'dock', 'hide', 'invisible'
439 -> call cfg_bar_mode($mode); BAR
441 state BAR_HIDDEN_STATE:
442 hidden_state = 'hide', 'show'
443 -> call cfg_bar_hidden_state($hidden_state); BAR
447 -> call cfg_bar_id($bar_id); BAR
450 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
451 -> call cfg_bar_modifier($modifier); BAR
453 state BAR_WHEEL_UP_CMD:
455 -> call cfg_bar_wheel_up_cmd($command); BAR
457 state BAR_WHEEL_DOWN_CMD:
459 -> call cfg_bar_wheel_down_cmd($command); BAR
463 -> BAR_BINDSYM_COMMAND
465 state BAR_BINDSYM_COMMAND:
467 -> call cfg_bar_bindsym($button, $command); BAR
470 position = 'top', 'bottom'
471 -> call cfg_bar_position($position); BAR
475 -> call cfg_bar_output($output); BAR
477 state BAR_TRAY_OUTPUT:
479 -> call cfg_bar_tray_output($output); BAR
481 state BAR_TRAY_PADDING:
483 -> BAR_TRAY_PADDING_PX
485 state BAR_TRAY_PADDING_PX:
489 -> call cfg_bar_tray_padding(&padding_px); BAR
493 -> call cfg_bar_font($font); BAR
495 state BAR_SEPARATOR_SYMBOL:
497 -> call cfg_bar_separator_symbol($separator); BAR
499 state BAR_BINDING_MODE_INDICATOR:
501 -> call cfg_bar_binding_mode_indicator($value); BAR
503 state BAR_WORKSPACE_BUTTONS:
505 -> call cfg_bar_workspace_buttons($value); BAR
507 state BAR_STRIP_WORKSPACE_NUMBERS:
509 -> call cfg_bar_strip_workspace_numbers($value); BAR
513 -> call cfg_bar_verbose($value); BAR
515 state BAR_COLORS_BRACE:
523 '#' -> BAR_COLORS_IGNORE_LINE
524 'set' -> BAR_COLORS_IGNORE_LINE
525 colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
527 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
532 # We ignore comments and 'set' lines (variables).
533 state BAR_COLORS_IGNORE_LINE:
537 state BAR_COLORS_SINGLE:
539 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
541 state BAR_COLORS_BORDER:
543 -> BAR_COLORS_BACKGROUND
545 state BAR_COLORS_BACKGROUND:
549 state BAR_COLORS_TEXT:
551 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
553 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS