]> git.sur5r.net Git - i3/i3/blob - parser-specs/config.spec
Merge "force_focus_wrapping" option into "focus_wrapping force"
[i3/i3] / parser-specs / config.spec
1 # vim:ts=2:sw=2:expandtab
2 #
3 # i3 - an improved dynamic tiling window manager
4 # © 2009 Michael Stapelberg and contributors (see also: LICENSE)
5 #
6 # parser-specs/config.spec: Specification file for generate-command-parser.pl
7 # which will generate the appropriate header files for our C parser.
8 #
9 # Use :source highlighting.vim in vim to get syntax highlighting
10 # for this file.
11
12 # TODO: should we implement an include statement for the criteria part so we DRY?
13
14 state INITIAL:
15   # We have an end token here for all the commands which just call some
16   # function without using an explicit 'end' token.
17   end ->
18   error ->
19   '#'                                      -> IGNORE_LINE
20   'set '                                   -> IGNORE_LINE
21   'set  '                                  -> IGNORE_LINE
22   'set_from_resource'                      -> IGNORE_LINE
23   bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
24   'bar'                                    -> BARBRACE
25   'font'                                   -> FONT
26   'mode'                                   -> MODENAME
27   'floating_minimum_size'                  -> FLOATING_MINIMUM_SIZE_WIDTH
28   'floating_maximum_size'                  -> FLOATING_MAXIMUM_SIZE_WIDTH
29   'floating_modifier'                      -> FLOATING_MODIFIER
30   'default_orientation'                    -> DEFAULT_ORIENTATION
31   'workspace_layout'                       -> WORKSPACE_LAYOUT
32   windowtype = 'new_window', 'new_float'   -> NEW_WINDOW
33   'hide_edge_borders'                      -> HIDE_EDGE_BORDERS
34   'for_window'                             -> FOR_WINDOW
35   'assign'                                 -> ASSIGN
36   'no_focus'                               -> NO_FOCUS
37   'focus_follows_mouse'                    -> FOCUS_FOLLOWS_MOUSE
38   'mouse_warping'                          -> MOUSE_WARPING
39   'focus_wrapping'                         -> FOCUS_WRAPPING
40   'force_focus_wrapping'                   -> FORCE_FOCUS_WRAPPING
41   'force_xinerama', 'force-xinerama'       -> FORCE_XINERAMA
42   'disable_randr15', 'disable-randr15'     -> DISABLE_RANDR15
43   'workspace_auto_back_and_forth'          -> WORKSPACE_BACK_AND_FORTH
44   'fake_outputs', 'fake-outputs'           -> FAKE_OUTPUTS
45   'force_display_urgency_hint'             -> FORCE_DISPLAY_URGENCY_HINT
46   'focus_on_window_activation'             -> FOCUS_ON_WINDOW_ACTIVATION
47   'show_marks'                             -> SHOW_MARKS
48   'workspace'                              -> WORKSPACE
49   'ipc_socket', 'ipc-socket'               -> IPC_SOCKET
50   'restart_state'                          -> RESTART_STATE
51   'popup_during_fullscreen'                -> POPUP_DURING_FULLSCREEN
52   exectype = 'exec_always', 'exec'         -> EXEC
53   colorclass = 'client.background'
54       -> COLOR_SINGLE
55   colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
56       -> COLOR_BORDER
57
58 # We ignore comments and 'set' lines (variables).
59 state IGNORE_LINE:
60   line
61       -> INITIAL
62
63 # floating_minimum_size <width> x <height>
64 state FLOATING_MINIMUM_SIZE_WIDTH:
65   width = number
66       -> FLOATING_MINIMUM_SIZE_X
67
68 state FLOATING_MINIMUM_SIZE_X:
69   'x'
70       -> FLOATING_MINIMUM_SIZE_HEIGHT
71
72 state FLOATING_MINIMUM_SIZE_HEIGHT:
73   height = number
74       -> call cfg_floating_minimum_size(&width, &height)
75
76 # floating_maximum_size <width> x <height>
77 state FLOATING_MAXIMUM_SIZE_WIDTH:
78   width = number
79       -> FLOATING_MAXIMUM_SIZE_X
80
81 state FLOATING_MAXIMUM_SIZE_X:
82   'x'
83       -> FLOATING_MAXIMUM_SIZE_HEIGHT
84
85 state FLOATING_MAXIMUM_SIZE_HEIGHT:
86   height = number
87       -> call cfg_floating_maximum_size(&width, &height)
88
89 # floating_modifier <modifier>
90 state FLOATING_MODIFIER:
91   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
92       ->
93   '+'
94       ->
95   end
96       -> call cfg_floating_modifier($modifiers)
97
98 # default_orientation <horizontal|vertical|auto>
99 state DEFAULT_ORIENTATION:
100   orientation = 'horizontal', 'vertical', 'auto'
101       -> call cfg_default_orientation($orientation)
102
103 # workspace_layout <default|stacking|tabbed>
104 state WORKSPACE_LAYOUT:
105   layout = 'default', 'stacking', 'stacked', 'tabbed'
106       -> call cfg_workspace_layout($layout)
107
108 # new_window <normal|1pixel|none>
109 # new_float <normal|1pixel|none>
110 state NEW_WINDOW:
111   border = 'normal', 'pixel'
112       -> NEW_WINDOW_PIXELS
113   border = '1pixel', 'none'
114       -> call cfg_new_window($windowtype, $border, -1)
115
116 state NEW_WINDOW_PIXELS:
117   end
118       -> call cfg_new_window($windowtype, $border, 2)
119   width = number
120       -> NEW_WINDOW_PIXELS_PX
121
122 state NEW_WINDOW_PIXELS_PX:
123   'px'
124       ->
125   end
126       -> call cfg_new_window($windowtype, $border, &width)
127
128 # hide_edge_borders <none|vertical|horizontal|both|smart>
129 # also hide_edge_borders <bool> for compatibility
130 state HIDE_EDGE_BORDERS:
131   hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
132       -> call cfg_hide_edge_borders($hide_borders)
133   hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
134       -> call cfg_hide_edge_borders($hide_borders)
135
136 # for_window <criteria> command
137 state FOR_WINDOW:
138   '['
139       -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
140
141 state FOR_WINDOW_COMMAND:
142   command = string
143       -> call cfg_for_window($command)
144
145 # assign <criteria> [→] workspace
146 state ASSIGN:
147   '['
148       -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
149
150 state ASSIGN_WORKSPACE:
151   '→'
152       ->
153   'workspace'
154       ->
155   'number'
156       -> ASSIGN_WORKSPACE_NUMBER
157   workspace = string
158       -> call cfg_assign($workspace, 0)
159
160 state ASSIGN_WORKSPACE_NUMBER:
161   number = string
162       -> call cfg_assign($number, 1)
163
164 # no_focus <criteria>
165 state NO_FOCUS:
166   '['
167       -> call cfg_criteria_init(NO_FOCUS_END); CRITERIA
168
169 state NO_FOCUS_END:
170   end
171       -> call cfg_no_focus()
172
173 # Criteria: Used by for_window and assign.
174 state CRITERIA:
175   ctype = 'class'       -> CRITERION
176   ctype = 'instance'    -> CRITERION
177   ctype = 'window_role' -> CRITERION
178   ctype = 'con_id'      -> CRITERION
179   ctype = 'id'          -> CRITERION
180   ctype = 'window_type' -> CRITERION
181   ctype = 'con_mark'    -> CRITERION
182   ctype = 'title'       -> CRITERION
183   ctype = 'urgent'      -> CRITERION
184   ctype = 'workspace'   -> CRITERION
185   ctype = 'tiling', 'floating'
186       -> call cfg_criteria_add($ctype, NULL); CRITERIA
187   ']'
188       -> call cfg_criteria_pop_state()
189
190 state CRITERION:
191   '=' -> CRITERION_STR
192
193 state CRITERION_STR:
194   cvalue = word
195       -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
196
197 # focus_follows_mouse bool
198 state FOCUS_FOLLOWS_MOUSE:
199   value = word
200       -> call cfg_focus_follows_mouse($value)
201
202 # mouse_warping warping_t
203 state MOUSE_WARPING:
204   value = 'none', 'output'
205       -> call cfg_mouse_warping($value)
206
207 # focus_wrapping
208 state FOCUS_WRAPPING:
209   value = '1', 'yes', 'true', 'on', 'enable', 'active', '0', 'no', 'false', 'off', 'disable', 'inactive', 'force'
210       -> call cfg_focus_wrapping($value)
211
212 # force_focus_wrapping
213 state FORCE_FOCUS_WRAPPING:
214   value = word
215       -> call cfg_force_focus_wrapping($value)
216
217 # force_xinerama
218 state FORCE_XINERAMA:
219   value = word
220       -> call cfg_force_xinerama($value)
221
222 # disable_randr15
223 state DISABLE_RANDR15:
224   value = word
225       -> call cfg_disable_randr15($value)
226
227 # workspace_back_and_forth
228 state WORKSPACE_BACK_AND_FORTH:
229   value = word
230       -> call cfg_workspace_back_and_forth($value)
231
232
233 # fake_outputs (for testcases)
234 state FAKE_OUTPUTS:
235   outputs = string
236       -> call cfg_fake_outputs($outputs)
237
238 # force_display_urgency_hint <timeout> ms
239 state FORCE_DISPLAY_URGENCY_HINT:
240   duration_ms = number
241       -> FORCE_DISPLAY_URGENCY_HINT_MS
242
243 # show_marks
244 state SHOW_MARKS:
245   value = word
246       -> call cfg_show_marks($value)
247
248 state FORCE_DISPLAY_URGENCY_HINT_MS:
249   'ms'
250       ->
251   end
252       -> call cfg_force_display_urgency_hint(&duration_ms)
253
254 # focus_on_window_activation <smart|urgent|focus|none>
255 state FOCUS_ON_WINDOW_ACTIVATION:
256   mode = word
257       -> call cfg_focus_on_window_activation($mode)
258
259 # workspace <workspace> output <output>
260 state WORKSPACE:
261   workspace = word
262     -> WORKSPACE_OUTPUT
263
264 state WORKSPACE_OUTPUT:
265   'output'
266       -> WORKSPACE_OUTPUT_STR
267
268 state WORKSPACE_OUTPUT_STR:
269   output = word
270       -> call cfg_workspace($workspace, $output)
271
272 # ipc-socket <path>
273 state IPC_SOCKET:
274   path = string
275       -> call cfg_ipc_socket($path)
276
277 # restart_state <path> (for testcases)
278 state RESTART_STATE:
279   path = string
280       -> call cfg_restart_state($path)
281
282 # popup_during_fullscreen
283 state POPUP_DURING_FULLSCREEN:
284   value = 'ignore', 'leave_fullscreen', 'smart'
285       -> call cfg_popup_during_fullscreen($value)
286
287 # client.background <hexcolor>
288 state COLOR_SINGLE:
289   color = word
290       -> call cfg_color_single($colorclass, $color)
291
292 # colorclass border background text indicator
293 state COLOR_BORDER:
294   border = word
295       -> COLOR_BACKGROUND
296
297 state COLOR_BACKGROUND:
298   background = word
299       -> COLOR_TEXT
300
301 state COLOR_TEXT:
302   text = word
303       -> COLOR_INDICATOR
304
305 state COLOR_INDICATOR:
306   indicator = word
307       -> COLOR_CHILD_BORDER
308   end
309       -> call cfg_color($colorclass, $border, $background, $text, NULL, NULL)
310
311 state COLOR_CHILD_BORDER:
312   child_border = word
313       -> call cfg_color($colorclass, $border, $background, $text, $indicator, $child_border)
314   end
315       -> call cfg_color($colorclass, $border, $background, $text, $indicator, NULL)
316
317 # <exec|exec_always> [--no-startup-id] command
318 state EXEC:
319   no_startup_id = '--no-startup-id'
320       ->
321   command = string
322       -> call cfg_exec($exectype, $no_startup_id, $command)
323
324 # font font
325 state FONT:
326   font = string
327       -> call cfg_font($font)
328
329 # bindsym/bindcode
330 state BINDING:
331   release = '--release'
332       ->
333   border = '--border'
334       ->
335   whole_window = '--whole-window'
336       ->
337   exclude_titlebar = '--exclude-titlebar'
338       ->
339   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
340       ->
341   '+'
342       ->
343   key = word
344       -> BINDCOMMAND
345
346 state BINDCOMMAND:
347   release = '--release'
348       ->
349   border = '--border'
350       ->
351   whole_window = '--whole-window'
352       ->
353   exclude_titlebar = '--exclude-titlebar'
354       ->
355   command = string
356       -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command)
357
358 ################################################################################
359 # Mode configuration
360 ################################################################################
361
362 state MODENAME:
363   pango_markup = '--pango_markup'
364       ->
365   modename = word
366       -> call cfg_enter_mode($pango_markup, $modename); MODEBRACE
367
368 state MODEBRACE:
369   end
370       ->
371   '{'
372       -> MODE
373
374 state MODE:
375   end ->
376   error ->
377   '#' -> MODE_IGNORE_LINE
378   'set' -> MODE_IGNORE_LINE
379   bindtype = 'bindsym', 'bindcode', 'bind'
380       -> MODE_BINDING
381   '}'
382       -> INITIAL
383
384 # We ignore comments and 'set' lines (variables).
385 state MODE_IGNORE_LINE:
386   line
387       -> MODE
388
389 state MODE_BINDING:
390   release = '--release'
391       ->
392   border = '--border'
393       ->
394   whole_window = '--whole-window'
395       ->
396   exclude_titlebar = '--exclude-titlebar'
397       ->
398   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', 'Group1', 'Group2', 'Group3', 'Group4', '$mod'
399       ->
400   '+'
401       ->
402   key = word
403       -> MODE_BINDCOMMAND
404
405 state MODE_BINDCOMMAND:
406   release = '--release'
407       ->
408   border = '--border'
409       ->
410   whole_window = '--whole-window'
411       ->
412   exclude_titlebar = '--exclude-titlebar'
413       ->
414   command = string
415       -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command); MODE
416
417 ################################################################################
418 # Bar configuration (i3bar)
419 ################################################################################
420
421 state BARBRACE:
422   end
423       ->
424   '{'
425       -> call cfg_bar_start(); BAR
426
427 state BAR:
428   end ->
429   error ->
430   '#' -> BAR_IGNORE_LINE
431   'set' -> BAR_IGNORE_LINE
432   'i3bar_command'          -> BAR_BAR_COMMAND
433   'status_command'         -> BAR_STATUS_COMMAND
434   'socket_path'            -> BAR_SOCKET_PATH
435   'mode'                   -> BAR_MODE
436   'hidden_state'           -> BAR_HIDDEN_STATE
437   'id'                     -> BAR_ID
438   'modifier'               -> BAR_MODIFIER
439   'wheel_up_cmd'           -> BAR_WHEEL_UP_CMD
440   'wheel_down_cmd'         -> BAR_WHEEL_DOWN_CMD
441   'bindsym'                -> BAR_BINDSYM
442   'position'               -> BAR_POSITION
443   'output'                 -> BAR_OUTPUT
444   'tray_output'            -> BAR_TRAY_OUTPUT
445   'tray_padding'           -> BAR_TRAY_PADDING
446   'font'                   -> BAR_FONT
447   'separator_symbol'       -> BAR_SEPARATOR_SYMBOL
448   'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
449   'workspace_buttons'      -> BAR_WORKSPACE_BUTTONS
450   'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
451   'verbose'                -> BAR_VERBOSE
452   'colors'                 -> BAR_COLORS_BRACE
453   '}'
454       -> call cfg_bar_finish(); INITIAL
455
456 # We ignore comments and 'set' lines (variables).
457 state BAR_IGNORE_LINE:
458   line
459       -> BAR
460
461 state BAR_BAR_COMMAND:
462   command = string
463       -> call cfg_bar_i3bar_command($command); BAR
464
465 state BAR_STATUS_COMMAND:
466   command = string
467       -> call cfg_bar_status_command($command); BAR
468
469 state BAR_SOCKET_PATH:
470   path = string
471       -> call cfg_bar_socket_path($path); BAR
472
473 state BAR_MODE:
474   mode = 'dock', 'hide', 'invisible'
475       -> call cfg_bar_mode($mode); BAR
476
477 state BAR_HIDDEN_STATE:
478   hidden_state = 'hide', 'show'
479       -> call cfg_bar_hidden_state($hidden_state); BAR
480
481 state BAR_ID:
482   bar_id = word
483       -> call cfg_bar_id($bar_id); BAR
484
485 state BAR_MODIFIER:
486   modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift', 'none', 'off'
487       -> call cfg_bar_modifier($modifier); BAR
488
489 state BAR_WHEEL_UP_CMD:
490   command = string
491       -> call cfg_bar_wheel_up_cmd($command); BAR
492
493 state BAR_WHEEL_DOWN_CMD:
494   command = string
495       -> call cfg_bar_wheel_down_cmd($command); BAR
496
497 state BAR_BINDSYM:
498   button = word
499       -> BAR_BINDSYM_COMMAND
500
501 state BAR_BINDSYM_COMMAND:
502   command = string
503       -> call cfg_bar_bindsym($button, $command); BAR
504
505 state BAR_POSITION:
506   position = 'top', 'bottom'
507       -> call cfg_bar_position($position); BAR
508
509 state BAR_OUTPUT:
510   output = string
511       -> call cfg_bar_output($output); BAR
512
513 state BAR_TRAY_OUTPUT:
514   output = word
515       -> call cfg_bar_tray_output($output); BAR
516
517 state BAR_TRAY_PADDING:
518   padding_px = number
519       -> BAR_TRAY_PADDING_PX
520
521 state BAR_TRAY_PADDING_PX:
522   'px'
523       ->
524   end
525       -> call cfg_bar_tray_padding(&padding_px); BAR
526
527 state BAR_FONT:
528   font = string
529       -> call cfg_bar_font($font); BAR
530
531 state BAR_SEPARATOR_SYMBOL:
532   separator = string
533       -> call cfg_bar_separator_symbol($separator); BAR
534
535 state BAR_BINDING_MODE_INDICATOR:
536   value = word
537       -> call cfg_bar_binding_mode_indicator($value); BAR
538
539 state BAR_WORKSPACE_BUTTONS:
540   value = word
541       -> call cfg_bar_workspace_buttons($value); BAR
542
543 state BAR_STRIP_WORKSPACE_NUMBERS:
544   value = word
545       -> call cfg_bar_strip_workspace_numbers($value); BAR
546
547 state BAR_VERBOSE:
548   value = word
549       -> call cfg_bar_verbose($value); BAR
550
551 state BAR_COLORS_BRACE:
552   end
553       ->
554   '{'
555       -> BAR_COLORS
556
557 state BAR_COLORS:
558   end ->
559   '#' -> BAR_COLORS_IGNORE_LINE
560   'set' -> BAR_COLORS_IGNORE_LINE
561   colorclass = 'background', 'statusline', 'separator', 'focused_background', 'focused_statusline', 'focused_separator'
562       -> BAR_COLORS_SINGLE
563   colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace', 'binding_mode'
564       -> BAR_COLORS_BORDER
565   '}'
566       -> BAR
567
568 # We ignore comments and 'set' lines (variables).
569 state BAR_COLORS_IGNORE_LINE:
570   line
571       -> BAR_COLORS
572
573 state BAR_COLORS_SINGLE:
574   color = word
575       -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
576
577 state BAR_COLORS_BORDER:
578   border = word
579       -> BAR_COLORS_BACKGROUND
580
581 state BAR_COLORS_BACKGROUND:
582   background = word
583       -> BAR_COLORS_TEXT
584
585 state BAR_COLORS_TEXT:
586   end
587       -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
588   text = word
589       -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS