1 # vim:ts=2:sw=2:expandtab
3 # i3 - an improved dynamic tiling window manager
4 # © 2009-2012 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 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
35 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
36 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
37 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
38 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
39 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
40 'workspace' -> WORKSPACE
41 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
42 'restart_state' -> RESTART_STATE
43 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
44 exectype = 'exec_always', 'exec' -> EXEC
45 colorclass = 'client.background'
47 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent'
50 # We ignore comments and 'set' lines (variables).
55 # floating_minimum_size <width> x <height>
56 state FLOATING_MINIMUM_SIZE_WIDTH:
58 -> FLOATING_MINIMUM_SIZE_X
60 state FLOATING_MINIMUM_SIZE_X:
62 -> FLOATING_MINIMUM_SIZE_HEIGHT
64 state FLOATING_MINIMUM_SIZE_HEIGHT:
66 -> call cfg_floating_minimum_size(&width, &height)
68 # floating_maximum_size <width> x <height>
69 state FLOATING_MAXIMUM_SIZE_WIDTH:
71 -> FLOATING_MAXIMUM_SIZE_X
73 state FLOATING_MAXIMUM_SIZE_X:
75 -> FLOATING_MAXIMUM_SIZE_HEIGHT
77 state FLOATING_MAXIMUM_SIZE_HEIGHT:
79 -> call cfg_floating_maximum_size(&width, &height)
81 # floating_modifier <modifier>
82 state FLOATING_MODIFIER:
83 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
88 -> call cfg_floating_modifier($modifiers)
90 # default_orientation <horizontal|vertical|auto>
91 state DEFAULT_ORIENTATION:
92 orientation = 'horizontal', 'vertical', 'auto'
93 -> call cfg_default_orientation($orientation)
95 # workspace_layout <default|stacking|tabbed>
96 state WORKSPACE_LAYOUT:
97 layout = 'default', 'stacking', 'stacked', 'tabbed'
98 -> call cfg_workspace_layout($layout)
100 # new_window <normal|1pixel|none>
101 # new_float <normal|1pixel|none>
102 # TODO: new_float is not in the userguide yet
103 # TODO: pixel is not in the userguide yet
105 border = 'normal', 'pixel'
107 border = '1pixel', 'none'
108 -> call cfg_new_window($windowtype, $border, -1)
110 state NEW_WINDOW_PIXELS:
112 -> call cfg_new_window($windowtype, $border, 2)
114 -> NEW_WINDOW_PIXELS_PX
116 state NEW_WINDOW_PIXELS_PX:
120 -> call cfg_new_window($windowtype, $border, &width)
122 # hide_edge_borders <none|vertical|horizontal|both>
123 # also hide_edge_borders <bool> for compatibility
124 state HIDE_EDGE_BORDERS:
125 hide_borders = 'none', 'vertical', 'horizontal', 'both'
126 -> call cfg_hide_edge_borders($hide_borders)
127 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
128 -> call cfg_hide_edge_borders($hide_borders)
130 # for_window <criteria> command
133 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
135 state FOR_WINDOW_COMMAND:
137 -> call cfg_for_window($command)
139 # assign <criteria> [→] workspace
142 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
144 state ASSIGN_WORKSPACE:
148 -> call cfg_assign($workspace)
150 # Criteria: Used by for_window and assign.
152 ctype = 'class' -> CRITERION
153 ctype = 'instance' -> CRITERION
154 ctype = 'window_role' -> CRITERION
155 ctype = 'con_id' -> CRITERION
156 ctype = 'id' -> CRITERION
157 ctype = 'con_mark' -> CRITERION
158 ctype = 'title' -> CRITERION
159 ctype = 'urgent' -> CRITERION
161 -> call cfg_criteria_pop_state()
168 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
170 # focus_follows_mouse bool
171 state FOCUS_FOLLOWS_MOUSE:
173 -> call cfg_focus_follows_mouse($value)
175 # force_focus_wrapping
176 state FORCE_FOCUS_WRAPPING:
178 -> call cfg_force_focus_wrapping($value)
181 state FORCE_XINERAMA:
183 -> call cfg_force_xinerama($value)
185 # workspace_back_and_forth
186 state WORKSPACE_BACK_AND_FORTH:
188 -> call cfg_workspace_back_and_forth($value)
191 # fake_outputs (for testcases)
194 -> call cfg_fake_outputs($outputs)
196 # force_display_urgency_hint <timeout> ms
197 state FORCE_DISPLAY_URGENCY_HINT:
199 -> FORCE_DISPLAY_URGENCY_HINT_MS
201 state FORCE_DISPLAY_URGENCY_HINT_MS:
205 -> call cfg_force_display_urgency_hint(&duration_ms)
207 # workspace <workspace> output <output>
212 state WORKSPACE_OUTPUT:
214 -> WORKSPACE_OUTPUT_STR
216 state WORKSPACE_OUTPUT_STR:
218 -> call cfg_workspace($workspace, $output)
223 -> call cfg_ipc_socket($path)
225 # restart_state <path> (for testcases)
228 -> call cfg_restart_state($path)
230 # popup_during_fullscreen
231 state POPUP_DURING_FULLSCREEN:
232 value = 'ignore', 'leave_fullscreen', 'smart'
233 -> call cfg_popup_during_fullscreen($value)
235 # client.background <hexcolor>
238 -> call cfg_color_single($colorclass, $color)
240 # colorclass border background text indicator
245 state COLOR_BACKGROUND:
253 state COLOR_INDICATOR:
255 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
257 -> call cfg_color($colorclass, $border, $background, $text, NULL)
259 # <exec|exec_always> [--no-startup-id] command
261 no_startup_id = '--no-startup-id'
264 -> call cfg_exec($exectype, $no_startup_id, $command)
269 -> call cfg_font($font)
273 release = '--release'
275 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
283 release = '--release'
286 -> call cfg_binding($bindtype, $modifiers, $key, $release, $command)
288 ################################################################################
290 ################################################################################
294 -> call cfg_enter_mode($modename); MODEBRACE
305 '#' -> MODE_IGNORE_LINE
306 'set' -> MODE_IGNORE_LINE
307 bindtype = 'bindsym', 'bindcode', 'bind'
312 # We ignore comments and 'set' lines (variables).
313 state MODE_IGNORE_LINE:
318 release = '--release'
320 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
327 state MODE_BINDCOMMAND:
328 release = '--release'
331 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $command); MODE
333 ################################################################################
334 # Bar configuration (i3bar)
335 ################################################################################
346 '#' -> BAR_IGNORE_LINE
347 'set' -> BAR_IGNORE_LINE
348 'i3bar_command' -> BAR_BAR_COMMAND
349 'status_command' -> BAR_STATUS_COMMAND
350 'socket_path' -> BAR_SOCKET_PATH
352 'hidden_state' -> BAR_HIDDEN_STATE
354 'modifier' -> BAR_MODIFIER
355 'position' -> BAR_POSITION
356 'output' -> BAR_OUTPUT
357 'tray_output' -> BAR_TRAY_OUTPUT
359 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
360 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
361 'verbose' -> BAR_VERBOSE
362 'colors' -> BAR_COLORS_BRACE
364 -> call cfg_bar_finish(); INITIAL
366 # We ignore comments and 'set' lines (variables).
367 state BAR_IGNORE_LINE:
371 state BAR_BAR_COMMAND:
373 -> call cfg_bar_i3bar_command($command); BAR
375 state BAR_STATUS_COMMAND:
377 -> call cfg_bar_status_command($command); BAR
379 state BAR_SOCKET_PATH:
381 -> call cfg_bar_socket_path($path); BAR
384 mode = 'dock', 'hide', 'invisible'
385 -> call cfg_bar_mode($mode); BAR
387 state BAR_HIDDEN_STATE:
388 hidden_state = 'hide', 'show'
389 -> call cfg_bar_hidden_state($hidden_state); BAR
393 -> call cfg_bar_id($bar_id); BAR
396 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
397 -> call cfg_bar_modifier($modifier); BAR
400 position = 'top', 'bottom'
401 -> call cfg_bar_position($position); BAR
405 -> call cfg_bar_output($output); BAR
407 state BAR_TRAY_OUTPUT:
409 -> call cfg_bar_tray_output($output); BAR
413 -> call cfg_bar_font($font); BAR
415 state BAR_BINDING_MODE_INDICATOR:
417 -> call cfg_bar_binding_mode_indicator($value); BAR
419 state BAR_WORKSPACE_BUTTONS:
421 -> call cfg_bar_workspace_buttons($value); BAR
425 -> call cfg_bar_verbose($value); BAR
427 state BAR_COLORS_BRACE:
435 '#' -> BAR_COLORS_IGNORE_LINE
436 'set' -> BAR_COLORS_IGNORE_LINE
437 colorclass = 'background', 'statusline', 'separator'
439 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace'
444 # We ignore comments and 'set' lines (variables).
445 state BAR_COLORS_IGNORE_LINE:
449 state BAR_COLORS_SINGLE:
451 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
453 state BAR_COLORS_BORDER:
455 -> BAR_COLORS_BACKGROUND
457 state BAR_COLORS_BACKGROUND:
461 state BAR_COLORS_TEXT:
463 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
465 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS