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 'mouse_warping' -> MOUSE_WARPING
36 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
37 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
38 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
39 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
40 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
41 'workspace' -> WORKSPACE
42 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
43 'restart_state' -> RESTART_STATE
44 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
45 exectype = 'exec_always', 'exec' -> EXEC
46 colorclass = 'client.background'
48 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
51 # We ignore comments and 'set' lines (variables).
56 # floating_minimum_size <width> x <height>
57 state FLOATING_MINIMUM_SIZE_WIDTH:
59 -> FLOATING_MINIMUM_SIZE_X
61 state FLOATING_MINIMUM_SIZE_X:
63 -> FLOATING_MINIMUM_SIZE_HEIGHT
65 state FLOATING_MINIMUM_SIZE_HEIGHT:
67 -> call cfg_floating_minimum_size(&width, &height)
69 # floating_maximum_size <width> x <height>
70 state FLOATING_MAXIMUM_SIZE_WIDTH:
72 -> FLOATING_MAXIMUM_SIZE_X
74 state FLOATING_MAXIMUM_SIZE_X:
76 -> FLOATING_MAXIMUM_SIZE_HEIGHT
78 state FLOATING_MAXIMUM_SIZE_HEIGHT:
80 -> call cfg_floating_maximum_size(&width, &height)
82 # floating_modifier <modifier>
83 state FLOATING_MODIFIER:
84 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
89 -> call cfg_floating_modifier($modifiers)
91 # default_orientation <horizontal|vertical|auto>
92 state DEFAULT_ORIENTATION:
93 orientation = 'horizontal', 'vertical', 'auto'
94 -> call cfg_default_orientation($orientation)
96 # workspace_layout <default|stacking|tabbed>
97 state WORKSPACE_LAYOUT:
98 layout = 'default', 'stacking', 'stacked', 'tabbed'
99 -> call cfg_workspace_layout($layout)
101 # new_window <normal|1pixel|none>
102 # new_float <normal|1pixel|none>
103 # TODO: new_float is not in the userguide yet
104 # TODO: pixel is not in the userguide yet
106 border = 'normal', 'pixel'
108 border = '1pixel', 'none'
109 -> call cfg_new_window($windowtype, $border, -1)
111 state NEW_WINDOW_PIXELS:
113 -> call cfg_new_window($windowtype, $border, 2)
115 -> NEW_WINDOW_PIXELS_PX
117 state NEW_WINDOW_PIXELS_PX:
121 -> call cfg_new_window($windowtype, $border, &width)
123 # hide_edge_borders <none|vertical|horizontal|both>
124 # also hide_edge_borders <bool> for compatibility
125 state HIDE_EDGE_BORDERS:
126 hide_borders = 'none', 'vertical', 'horizontal', 'both'
127 -> call cfg_hide_edge_borders($hide_borders)
128 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
129 -> call cfg_hide_edge_borders($hide_borders)
131 # for_window <criteria> command
134 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
136 state FOR_WINDOW_COMMAND:
138 -> call cfg_for_window($command)
140 # assign <criteria> [→] workspace
143 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
145 state ASSIGN_WORKSPACE:
149 -> call cfg_assign($workspace)
151 # Criteria: Used by for_window and assign.
153 ctype = 'class' -> CRITERION
154 ctype = 'instance' -> CRITERION
155 ctype = 'window_role' -> CRITERION
156 ctype = 'con_id' -> CRITERION
157 ctype = 'id' -> CRITERION
158 ctype = 'con_mark' -> CRITERION
159 ctype = 'title' -> CRITERION
160 ctype = 'urgent' -> CRITERION
162 -> call cfg_criteria_pop_state()
169 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
171 # focus_follows_mouse bool
172 state FOCUS_FOLLOWS_MOUSE:
174 -> call cfg_focus_follows_mouse($value)
176 # mouse_warping warping_t
178 value = 'none', 'output'
179 -> call cfg_mouse_warping($value)
181 # force_focus_wrapping
182 state FORCE_FOCUS_WRAPPING:
184 -> call cfg_force_focus_wrapping($value)
187 state FORCE_XINERAMA:
189 -> call cfg_force_xinerama($value)
191 # workspace_back_and_forth
192 state WORKSPACE_BACK_AND_FORTH:
194 -> call cfg_workspace_back_and_forth($value)
197 # fake_outputs (for testcases)
200 -> call cfg_fake_outputs($outputs)
202 # force_display_urgency_hint <timeout> ms
203 state FORCE_DISPLAY_URGENCY_HINT:
205 -> FORCE_DISPLAY_URGENCY_HINT_MS
207 state FORCE_DISPLAY_URGENCY_HINT_MS:
211 -> call cfg_force_display_urgency_hint(&duration_ms)
213 # workspace <workspace> output <output>
218 state WORKSPACE_OUTPUT:
220 -> WORKSPACE_OUTPUT_STR
222 state WORKSPACE_OUTPUT_STR:
224 -> call cfg_workspace($workspace, $output)
229 -> call cfg_ipc_socket($path)
231 # restart_state <path> (for testcases)
234 -> call cfg_restart_state($path)
236 # popup_during_fullscreen
237 state POPUP_DURING_FULLSCREEN:
238 value = 'ignore', 'leave_fullscreen', 'smart'
239 -> call cfg_popup_during_fullscreen($value)
241 # client.background <hexcolor>
244 -> call cfg_color_single($colorclass, $color)
246 # colorclass border background text indicator
251 state COLOR_BACKGROUND:
259 state COLOR_INDICATOR:
261 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
263 -> call cfg_color($colorclass, $border, $background, $text, NULL)
265 # <exec|exec_always> [--no-startup-id] command
267 no_startup_id = '--no-startup-id'
270 -> call cfg_exec($exectype, $no_startup_id, $command)
275 -> call cfg_font($font)
279 release = '--release'
281 whole_window = '--whole-window'
283 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
291 release = '--release'
293 whole_window = '--whole-window'
296 -> call cfg_binding($bindtype, $modifiers, $key, $release, $whole_window, $command)
298 ################################################################################
300 ################################################################################
304 -> call cfg_enter_mode($modename); MODEBRACE
315 '#' -> MODE_IGNORE_LINE
316 'set' -> MODE_IGNORE_LINE
317 bindtype = 'bindsym', 'bindcode', 'bind'
322 # We ignore comments and 'set' lines (variables).
323 state MODE_IGNORE_LINE:
328 release = '--release'
330 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
337 state MODE_BINDCOMMAND:
338 release = '--release'
340 whole_window = '--whole-window'
343 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $whole_window, $command); MODE
345 ################################################################################
346 # Bar configuration (i3bar)
347 ################################################################################
358 '#' -> BAR_IGNORE_LINE
359 'set' -> BAR_IGNORE_LINE
360 'i3bar_command' -> BAR_BAR_COMMAND
361 'status_command' -> BAR_STATUS_COMMAND
362 'socket_path' -> BAR_SOCKET_PATH
364 'hidden_state' -> BAR_HIDDEN_STATE
366 'modifier' -> BAR_MODIFIER
367 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
368 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
369 'position' -> BAR_POSITION
370 'output' -> BAR_OUTPUT
371 'tray_output' -> BAR_TRAY_OUTPUT
373 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
374 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
375 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
376 'verbose' -> BAR_VERBOSE
377 'colors' -> BAR_COLORS_BRACE
379 -> call cfg_bar_finish(); INITIAL
381 # We ignore comments and 'set' lines (variables).
382 state BAR_IGNORE_LINE:
386 state BAR_BAR_COMMAND:
388 -> call cfg_bar_i3bar_command($command); BAR
390 state BAR_STATUS_COMMAND:
392 -> call cfg_bar_status_command($command); BAR
394 state BAR_SOCKET_PATH:
396 -> call cfg_bar_socket_path($path); BAR
399 mode = 'dock', 'hide', 'invisible'
400 -> call cfg_bar_mode($mode); BAR
402 state BAR_HIDDEN_STATE:
403 hidden_state = 'hide', 'show'
404 -> call cfg_bar_hidden_state($hidden_state); BAR
408 -> call cfg_bar_id($bar_id); BAR
411 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
412 -> call cfg_bar_modifier($modifier); BAR
414 state BAR_WHEEL_UP_CMD:
416 -> call cfg_bar_wheel_up_cmd($command); BAR
418 state BAR_WHEEL_DOWN_CMD:
420 -> call cfg_bar_wheel_down_cmd($command); BAR
423 position = 'top', 'bottom'
424 -> call cfg_bar_position($position); BAR
428 -> call cfg_bar_output($output); BAR
430 state BAR_TRAY_OUTPUT:
432 -> call cfg_bar_tray_output($output); BAR
436 -> call cfg_bar_font($font); BAR
438 state BAR_BINDING_MODE_INDICATOR:
440 -> call cfg_bar_binding_mode_indicator($value); BAR
442 state BAR_WORKSPACE_BUTTONS:
444 -> call cfg_bar_workspace_buttons($value); BAR
446 state BAR_STRIP_WORKSPACE_NUMBERS:
448 -> call cfg_bar_strip_workspace_numbers($value); BAR
452 -> call cfg_bar_verbose($value); BAR
454 state BAR_COLORS_BRACE:
462 '#' -> BAR_COLORS_IGNORE_LINE
463 'set' -> BAR_COLORS_IGNORE_LINE
464 colorclass = 'background', 'statusline', 'separator'
466 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace'
471 # We ignore comments and 'set' lines (variables).
472 state BAR_COLORS_IGNORE_LINE:
476 state BAR_COLORS_SINGLE:
478 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
480 state BAR_COLORS_BORDER:
482 -> BAR_COLORS_BACKGROUND
484 state BAR_COLORS_BACKGROUND:
488 state BAR_COLORS_TEXT:
490 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
492 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS