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.
20 bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
24 'floating_minimum_size' -> FLOATING_MINIMUM_SIZE_WIDTH
25 'floating_maximum_size' -> FLOATING_MAXIMUM_SIZE_WIDTH
26 'floating_modifier' -> FLOATING_MODIFIER
27 'default_orientation' -> DEFAULT_ORIENTATION
28 'workspace_layout' -> WORKSPACE_LAYOUT
29 windowtype = 'new_window', 'new_float' -> NEW_WINDOW
30 'hide_edge_borders' -> HIDE_EDGE_BORDERS
31 'for_window' -> FOR_WINDOW
33 'focus_follows_mouse' -> FOCUS_FOLLOWS_MOUSE
34 'force_focus_wrapping' -> FORCE_FOCUS_WRAPPING
35 'force_xinerama', 'force-xinerama' -> FORCE_XINERAMA
36 'workspace_auto_back_and_forth' -> WORKSPACE_BACK_AND_FORTH
37 'fake_outputs', 'fake-outputs' -> FAKE_OUTPUTS
38 'force_display_urgency_hint' -> FORCE_DISPLAY_URGENCY_HINT
39 'workspace' -> WORKSPACE
40 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
41 'restart_state' -> RESTART_STATE
42 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
43 exectype = 'exec_always', 'exec' -> EXEC
44 colorclass = 'client.background'
46 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent'
49 # We ignore comments and 'set' lines (variables).
54 # floating_minimum_size <width> x <height>
55 state FLOATING_MINIMUM_SIZE_WIDTH:
57 -> FLOATING_MINIMUM_SIZE_X
59 state FLOATING_MINIMUM_SIZE_X:
61 -> FLOATING_MINIMUM_SIZE_HEIGHT
63 state FLOATING_MINIMUM_SIZE_HEIGHT:
65 -> call cfg_floating_minimum_size(&width, &height)
67 # floating_maximum_size <width> x <height>
68 state FLOATING_MAXIMUM_SIZE_WIDTH:
70 -> FLOATING_MAXIMUM_SIZE_X
72 state FLOATING_MAXIMUM_SIZE_X:
74 -> FLOATING_MAXIMUM_SIZE_HEIGHT
76 state FLOATING_MAXIMUM_SIZE_HEIGHT:
78 -> call cfg_floating_maximum_size(&width, &height)
80 # floating_modifier <modifier>
81 state FLOATING_MODIFIER:
82 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
87 -> call cfg_floating_modifier($modifiers)
89 # default_orientation <horizontal|vertical|auto>
90 state DEFAULT_ORIENTATION:
91 orientation = 'horizontal', 'vertical', 'auto'
92 -> call cfg_default_orientation($orientation)
94 # workspace_layout <default|stacking|tabbed>
95 state WORKSPACE_LAYOUT:
96 layout = 'default', 'stacking', 'stacked', 'tabbed'
97 -> call cfg_workspace_layout($layout)
99 # new_window <normal|1pixel|none>
100 # new_float <normal|1pixel|none>
101 # TODO: new_float is not in the userguide yet
102 # TODO: pixel is not in the userguide yet
104 border = 'normal', 'pixel'
106 border = '1pixel', 'none'
107 -> call cfg_new_window($windowtype, $border, -1)
109 state NEW_WINDOW_PIXELS:
111 -> call cfg_new_window($windowtype, $border, 2)
113 -> NEW_WINDOW_PIXELS_PX
115 state NEW_WINDOW_PIXELS_PX:
119 -> call cfg_new_window($windowtype, $border, &width)
121 # hide_edge_borders <none|vertical|horizontal|both>
122 # also hide_edge_borders <bool> for compatibility
123 state HIDE_EDGE_BORDERS:
124 hide_borders = 'none', 'vertical', 'horizontal', 'both'
125 -> call cfg_hide_edge_borders($hide_borders)
126 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
127 -> call cfg_hide_edge_borders($hide_borders)
129 # for_window <criteria> command
132 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
134 state FOR_WINDOW_COMMAND:
136 -> call cfg_for_window($command)
138 # assign <criteria> [→] workspace
141 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
143 state ASSIGN_WORKSPACE:
147 -> call cfg_assign($workspace)
149 # Criteria: Used by for_window and assign.
151 ctype = 'class' -> CRITERION
152 ctype = 'instance' -> CRITERION
153 ctype = 'window_role' -> CRITERION
154 ctype = 'con_id' -> CRITERION
155 ctype = 'id' -> CRITERION
156 ctype = 'con_mark' -> CRITERION
157 ctype = 'title' -> CRITERION
158 ctype = 'urgent' -> CRITERION
160 -> call cfg_criteria_pop_state()
167 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
169 # focus_follows_mouse bool
170 state FOCUS_FOLLOWS_MOUSE:
172 -> call cfg_focus_follows_mouse($value)
174 # force_focus_wrapping
175 state FORCE_FOCUS_WRAPPING:
177 -> call cfg_force_focus_wrapping($value)
180 state FORCE_XINERAMA:
182 -> call cfg_force_xinerama($value)
184 # workspace_back_and_forth
185 state WORKSPACE_BACK_AND_FORTH:
187 -> call cfg_workspace_back_and_forth($value)
190 # fake_outputs (for testcases)
193 -> call cfg_fake_outputs($outputs)
195 # force_display_urgency_hint <timeout> ms
196 state FORCE_DISPLAY_URGENCY_HINT:
198 -> FORCE_DISPLAY_URGENCY_HINT_MS
200 state FORCE_DISPLAY_URGENCY_HINT_MS:
204 -> call cfg_force_display_urgency_hint(&duration_ms)
206 # workspace <workspace> output <output>
211 state WORKSPACE_OUTPUT:
213 -> WORKSPACE_OUTPUT_STR
215 state WORKSPACE_OUTPUT_STR:
217 -> call cfg_workspace($workspace, $output)
222 -> call cfg_ipc_socket($path)
224 # restart_state <path> (for testcases)
227 -> call cfg_restart_state($path)
229 # popup_during_fullscreen
230 state POPUP_DURING_FULLSCREEN:
231 value = 'ignore', 'leave_fullscreen'
232 -> call cfg_popup_during_fullscreen($value)
234 # client.background <hexcolor>
237 -> call cfg_color_single($colorclass, $color)
239 # colorclass border background text indicator
244 state COLOR_BACKGROUND:
252 state COLOR_INDICATOR:
254 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
256 -> call cfg_color($colorclass, $border, $background, $text, NULL)
258 # <exec|exec_always> [--no-startup-id] command
260 no_startup_id = '--no-startup-id'
263 -> call cfg_exec($exectype, $no_startup_id, $command)
268 -> call cfg_font($font)
272 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch'
280 release = '--release'
283 -> call cfg_binding($bindtype, $modifiers, $key, $release, $command)
285 ################################################################################
287 ################################################################################
291 -> call cfg_enter_mode($modename); MODEBRACE
299 '#' -> MODE_IGNORE_LINE
300 'set' -> MODE_IGNORE_LINE
301 bindtype = 'bindsym', 'bindcode', 'bind'
306 # We ignore comments and 'set' lines (variables).
307 state MODE_IGNORE_LINE:
312 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch'
319 state MODE_BINDCOMMAND:
320 release = '--release'
323 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $command); MODE
325 ################################################################################
326 # Bar configuration (i3bar)
327 ################################################################################
335 '#' -> BAR_IGNORE_LINE
336 'set' -> BAR_IGNORE_LINE
337 'i3bar_command' -> BAR_BAR_COMMAND
338 'status_command' -> BAR_STATUS_COMMAND
339 'socket_path' -> BAR_SOCKET_PATH
341 'modifier' -> BAR_MODIFIER
342 'position' -> BAR_POSITION
343 'output' -> BAR_OUTPUT
344 'tray_output' -> BAR_TRAY_OUTPUT
346 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
347 'verbose' -> BAR_VERBOSE
348 'colors' -> BAR_COLORS_BRACE
350 -> call cfg_bar_finish(); INITIAL
352 # We ignore comments and 'set' lines (variables).
353 state BAR_IGNORE_LINE:
357 state BAR_BAR_COMMAND:
359 -> call cfg_bar_i3bar_command($command); BAR
361 state BAR_STATUS_COMMAND:
363 -> call cfg_bar_status_command($command); BAR
365 state BAR_SOCKET_PATH:
367 -> call cfg_bar_socket_path($path); BAR
370 mode = 'dock', 'hide'
371 -> call cfg_bar_mode($mode); BAR
374 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
375 -> call cfg_bar_modifier($modifier); BAR
378 position = 'top', 'bottom'
379 -> call cfg_bar_position($position); BAR
383 -> call cfg_bar_output($output); BAR
385 state BAR_TRAY_OUTPUT:
387 -> call cfg_bar_tray_output($output); BAR
391 -> call cfg_bar_font($font); BAR
393 state BAR_WORKSPACE_BUTTONS:
395 -> call cfg_bar_workspace_buttons($value); BAR
399 -> call cfg_bar_verbose($value); BAR
401 state BAR_COLORS_BRACE:
407 '#' -> BAR_COLORS_IGNORE_LINE
408 'set' -> BAR_COLORS_IGNORE_LINE
409 colorclass = 'background', 'statusline'
411 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace'
416 # We ignore comments and 'set' lines (variables).
417 state BAR_COLORS_IGNORE_LINE:
421 state BAR_COLORS_SINGLE:
423 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
425 state BAR_COLORS_BORDER:
427 -> BAR_COLORS_BACKGROUND
429 state BAR_COLORS_BACKGROUND:
433 state BAR_COLORS_TEXT:
435 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
437 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS