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 'focus_on_window_activation' -> FOCUS_ON_WINDOW_ACTIVATION
42 'show_marks' -> SHOW_MARKS
43 'workspace' -> WORKSPACE
44 'ipc_socket', 'ipc-socket' -> IPC_SOCKET
45 'restart_state' -> RESTART_STATE
46 'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
47 exectype = 'exec_always', 'exec' -> EXEC
48 colorclass = 'client.background'
50 colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
53 # We ignore comments and 'set' lines (variables).
58 # floating_minimum_size <width> x <height>
59 state FLOATING_MINIMUM_SIZE_WIDTH:
61 -> FLOATING_MINIMUM_SIZE_X
63 state FLOATING_MINIMUM_SIZE_X:
65 -> FLOATING_MINIMUM_SIZE_HEIGHT
67 state FLOATING_MINIMUM_SIZE_HEIGHT:
69 -> call cfg_floating_minimum_size(&width, &height)
71 # floating_maximum_size <width> x <height>
72 state FLOATING_MAXIMUM_SIZE_WIDTH:
74 -> FLOATING_MAXIMUM_SIZE_X
76 state FLOATING_MAXIMUM_SIZE_X:
78 -> FLOATING_MAXIMUM_SIZE_HEIGHT
80 state FLOATING_MAXIMUM_SIZE_HEIGHT:
82 -> call cfg_floating_maximum_size(&width, &height)
84 # floating_modifier <modifier>
85 state FLOATING_MODIFIER:
86 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
91 -> call cfg_floating_modifier($modifiers)
93 # default_orientation <horizontal|vertical|auto>
94 state DEFAULT_ORIENTATION:
95 orientation = 'horizontal', 'vertical', 'auto'
96 -> call cfg_default_orientation($orientation)
98 # workspace_layout <default|stacking|tabbed>
99 state WORKSPACE_LAYOUT:
100 layout = 'default', 'stacking', 'stacked', 'tabbed'
101 -> call cfg_workspace_layout($layout)
103 # new_window <normal|1pixel|none>
104 # new_float <normal|1pixel|none>
105 # TODO: new_float is not in the userguide yet
106 # TODO: pixel is not in the userguide yet
108 border = 'normal', 'pixel'
110 border = '1pixel', 'none'
111 -> call cfg_new_window($windowtype, $border, -1)
113 state NEW_WINDOW_PIXELS:
115 -> call cfg_new_window($windowtype, $border, 2)
117 -> NEW_WINDOW_PIXELS_PX
119 state NEW_WINDOW_PIXELS_PX:
123 -> call cfg_new_window($windowtype, $border, &width)
125 # hide_edge_borders <none|vertical|horizontal|both>
126 # also hide_edge_borders <bool> for compatibility
127 state HIDE_EDGE_BORDERS:
128 hide_borders = 'none', 'vertical', 'horizontal', 'both'
129 -> call cfg_hide_edge_borders($hide_borders)
130 hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
131 -> call cfg_hide_edge_borders($hide_borders)
133 # for_window <criteria> command
136 -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
138 state FOR_WINDOW_COMMAND:
140 -> call cfg_for_window($command)
142 # assign <criteria> [→] workspace
145 -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
147 state ASSIGN_WORKSPACE:
151 -> call cfg_assign($workspace)
153 # Criteria: Used by for_window and assign.
155 ctype = 'class' -> CRITERION
156 ctype = 'instance' -> CRITERION
157 ctype = 'window_role' -> CRITERION
158 ctype = 'con_id' -> CRITERION
159 ctype = 'id' -> CRITERION
160 ctype = 'con_mark' -> CRITERION
161 ctype = 'title' -> CRITERION
162 ctype = 'urgent' -> CRITERION
164 -> call cfg_criteria_pop_state()
171 -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
173 # focus_follows_mouse bool
174 state FOCUS_FOLLOWS_MOUSE:
176 -> call cfg_focus_follows_mouse($value)
178 # mouse_warping warping_t
180 value = 'none', 'output'
181 -> call cfg_mouse_warping($value)
183 # force_focus_wrapping
184 state FORCE_FOCUS_WRAPPING:
186 -> call cfg_force_focus_wrapping($value)
189 state FORCE_XINERAMA:
191 -> call cfg_force_xinerama($value)
193 # workspace_back_and_forth
194 state WORKSPACE_BACK_AND_FORTH:
196 -> call cfg_workspace_back_and_forth($value)
199 # fake_outputs (for testcases)
202 -> call cfg_fake_outputs($outputs)
204 # force_display_urgency_hint <timeout> ms
205 state FORCE_DISPLAY_URGENCY_HINT:
207 -> FORCE_DISPLAY_URGENCY_HINT_MS
212 -> call cfg_show_marks($value)
214 state FORCE_DISPLAY_URGENCY_HINT_MS:
218 -> call cfg_force_display_urgency_hint(&duration_ms)
220 # focus_on_window_activation <smart|urgent|focus|none>
221 state FOCUS_ON_WINDOW_ACTIVATION:
223 -> call cfg_focus_on_window_activation($mode)
225 # workspace <workspace> output <output>
230 state WORKSPACE_OUTPUT:
232 -> WORKSPACE_OUTPUT_STR
234 state WORKSPACE_OUTPUT_STR:
236 -> call cfg_workspace($workspace, $output)
241 -> call cfg_ipc_socket($path)
243 # restart_state <path> (for testcases)
246 -> call cfg_restart_state($path)
248 # popup_during_fullscreen
249 state POPUP_DURING_FULLSCREEN:
250 value = 'ignore', 'leave_fullscreen', 'smart'
251 -> call cfg_popup_during_fullscreen($value)
253 # client.background <hexcolor>
256 -> call cfg_color_single($colorclass, $color)
258 # colorclass border background text indicator
263 state COLOR_BACKGROUND:
271 state COLOR_INDICATOR:
273 -> call cfg_color($colorclass, $border, $background, $text, $indicator)
275 -> call cfg_color($colorclass, $border, $background, $text, NULL)
277 # <exec|exec_always> [--no-startup-id] command
279 no_startup_id = '--no-startup-id'
282 -> call cfg_exec($exectype, $no_startup_id, $command)
287 -> call cfg_font($font)
291 release = '--release'
293 whole_window = '--whole-window'
295 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
303 release = '--release'
305 whole_window = '--whole-window'
308 -> call cfg_binding($bindtype, $modifiers, $key, $release, $whole_window, $command)
310 ################################################################################
312 ################################################################################
316 -> call cfg_enter_mode($modename); MODEBRACE
327 '#' -> MODE_IGNORE_LINE
328 'set' -> MODE_IGNORE_LINE
329 bindtype = 'bindsym', 'bindcode', 'bind'
334 # We ignore comments and 'set' lines (variables).
335 state MODE_IGNORE_LINE:
340 release = '--release'
342 modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
349 state MODE_BINDCOMMAND:
350 release = '--release'
352 whole_window = '--whole-window'
355 -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $whole_window, $command); MODE
357 ################################################################################
358 # Bar configuration (i3bar)
359 ################################################################################
370 '#' -> BAR_IGNORE_LINE
371 'set' -> BAR_IGNORE_LINE
372 'i3bar_command' -> BAR_BAR_COMMAND
373 'status_command' -> BAR_STATUS_COMMAND
374 'socket_path' -> BAR_SOCKET_PATH
376 'hidden_state' -> BAR_HIDDEN_STATE
378 'modifier' -> BAR_MODIFIER
379 'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
380 'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
381 'position' -> BAR_POSITION
382 'output' -> BAR_OUTPUT
383 'tray_output' -> BAR_TRAY_OUTPUT
385 'separator_symbol' -> BAR_SEPARATOR_SYMBOL
386 'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
387 'workspace_buttons' -> BAR_WORKSPACE_BUTTONS
388 'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
389 'verbose' -> BAR_VERBOSE
390 'colors' -> BAR_COLORS_BRACE
392 -> call cfg_bar_finish(); INITIAL
394 # We ignore comments and 'set' lines (variables).
395 state BAR_IGNORE_LINE:
399 state BAR_BAR_COMMAND:
401 -> call cfg_bar_i3bar_command($command); BAR
403 state BAR_STATUS_COMMAND:
405 -> call cfg_bar_status_command($command); BAR
407 state BAR_SOCKET_PATH:
409 -> call cfg_bar_socket_path($path); BAR
412 mode = 'dock', 'hide', 'invisible'
413 -> call cfg_bar_mode($mode); BAR
415 state BAR_HIDDEN_STATE:
416 hidden_state = 'hide', 'show'
417 -> call cfg_bar_hidden_state($hidden_state); BAR
421 -> call cfg_bar_id($bar_id); BAR
424 modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
425 -> call cfg_bar_modifier($modifier); BAR
427 state BAR_WHEEL_UP_CMD:
429 -> call cfg_bar_wheel_up_cmd($command); BAR
431 state BAR_WHEEL_DOWN_CMD:
433 -> call cfg_bar_wheel_down_cmd($command); BAR
436 position = 'top', 'bottom'
437 -> call cfg_bar_position($position); BAR
441 -> call cfg_bar_output($output); BAR
443 state BAR_TRAY_OUTPUT:
445 -> call cfg_bar_tray_output($output); BAR
449 -> call cfg_bar_font($font); BAR
451 state BAR_SEPARATOR_SYMBOL:
453 -> call cfg_bar_separator_symbol($separator); BAR
455 state BAR_BINDING_MODE_INDICATOR:
457 -> call cfg_bar_binding_mode_indicator($value); BAR
459 state BAR_WORKSPACE_BUTTONS:
461 -> call cfg_bar_workspace_buttons($value); BAR
463 state BAR_STRIP_WORKSPACE_NUMBERS:
465 -> call cfg_bar_strip_workspace_numbers($value); BAR
469 -> call cfg_bar_verbose($value); BAR
471 state BAR_COLORS_BRACE:
479 '#' -> BAR_COLORS_IGNORE_LINE
480 'set' -> BAR_COLORS_IGNORE_LINE
481 colorclass = 'background', 'statusline', 'separator'
483 colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace'
488 # We ignore comments and 'set' lines (variables).
489 state BAR_COLORS_IGNORE_LINE:
493 state BAR_COLORS_SINGLE:
495 -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
497 state BAR_COLORS_BORDER:
499 -> BAR_COLORS_BACKGROUND
501 state BAR_COLORS_BACKGROUND:
505 state BAR_COLORS_TEXT:
507 -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
509 -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS