]> git.sur5r.net Git - i3/i3/blob - parser-specs/config.spec
Added missing bar section for tray_output primary
[i3/i3] / parser-specs / config.spec
1 # vim:ts=2:sw=2:expandtab
2 #
3 # i3 - an improved dynamic tiling window manager
4 # © 2009-2012 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   bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
22   'bar'                                    -> BARBRACE
23   'font'                                   -> FONT
24   'mode'                                   -> MODENAME
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
33   'assign'                                 -> ASSIGN
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'
47       -> COLOR_SINGLE
48   colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
49       -> COLOR_BORDER
50
51 # We ignore comments and 'set' lines (variables).
52 state IGNORE_LINE:
53   line
54       -> INITIAL
55
56 # floating_minimum_size <width> x <height>
57 state FLOATING_MINIMUM_SIZE_WIDTH:
58   width = number
59       -> FLOATING_MINIMUM_SIZE_X
60
61 state FLOATING_MINIMUM_SIZE_X:
62   'x'
63       -> FLOATING_MINIMUM_SIZE_HEIGHT
64
65 state FLOATING_MINIMUM_SIZE_HEIGHT:
66   height = number
67       -> call cfg_floating_minimum_size(&width, &height)
68
69 # floating_maximum_size <width> x <height>
70 state FLOATING_MAXIMUM_SIZE_WIDTH:
71   width = number
72       -> FLOATING_MAXIMUM_SIZE_X
73
74 state FLOATING_MAXIMUM_SIZE_X:
75   'x'
76       -> FLOATING_MAXIMUM_SIZE_HEIGHT
77
78 state FLOATING_MAXIMUM_SIZE_HEIGHT:
79   height = number
80       -> call cfg_floating_maximum_size(&width, &height)
81
82 # floating_modifier <modifier>
83 state FLOATING_MODIFIER:
84   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl'
85       ->
86   '+'
87       ->
88   end
89       -> call cfg_floating_modifier($modifiers)
90
91 # default_orientation <horizontal|vertical|auto>
92 state DEFAULT_ORIENTATION:
93   orientation = 'horizontal', 'vertical', 'auto'
94       -> call cfg_default_orientation($orientation)
95
96 # workspace_layout <default|stacking|tabbed>
97 state WORKSPACE_LAYOUT:
98   layout = 'default', 'stacking', 'stacked', 'tabbed'
99       -> call cfg_workspace_layout($layout)
100
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
105 state NEW_WINDOW:
106   border = 'normal', 'pixel'
107       -> NEW_WINDOW_PIXELS
108   border = '1pixel', 'none'
109       -> call cfg_new_window($windowtype, $border, -1)
110
111 state NEW_WINDOW_PIXELS:
112   end
113       -> call cfg_new_window($windowtype, $border, 2)
114   width = number
115       -> NEW_WINDOW_PIXELS_PX
116
117 state NEW_WINDOW_PIXELS_PX:
118   'px'
119       ->
120   end
121       -> call cfg_new_window($windowtype, $border, &width)
122
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)
130
131 # for_window <criteria> command
132 state FOR_WINDOW:
133   '['
134       -> call cfg_criteria_init(FOR_WINDOW_COMMAND); CRITERIA
135
136 state FOR_WINDOW_COMMAND:
137   command = string
138       -> call cfg_for_window($command)
139
140 # assign <criteria> [→] workspace
141 state ASSIGN:
142   '['
143       -> call cfg_criteria_init(ASSIGN_WORKSPACE); CRITERIA
144
145 state ASSIGN_WORKSPACE:
146   '→'
147       ->
148   workspace = string
149       -> call cfg_assign($workspace)
150
151 # Criteria: Used by for_window and assign.
152 state CRITERIA:
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
161   ']'
162       -> call cfg_criteria_pop_state()
163
164 state CRITERION:
165   '=' -> CRITERION_STR
166
167 state CRITERION_STR:
168   cvalue = word
169       -> call cfg_criteria_add($ctype, $cvalue); CRITERIA
170
171 # focus_follows_mouse bool
172 state FOCUS_FOLLOWS_MOUSE:
173   value = word
174       -> call cfg_focus_follows_mouse($value)
175
176 # mouse_warping warping_t
177 state MOUSE_WARPING:
178   value = 'none', 'output'
179       -> call cfg_mouse_warping($value)
180
181 # force_focus_wrapping
182 state FORCE_FOCUS_WRAPPING:
183   value = word
184       -> call cfg_force_focus_wrapping($value)
185
186 # force_xinerama
187 state FORCE_XINERAMA:
188   value = word
189       -> call cfg_force_xinerama($value)
190
191 # workspace_back_and_forth
192 state WORKSPACE_BACK_AND_FORTH:
193   value = word
194       -> call cfg_workspace_back_and_forth($value)
195
196
197 # fake_outputs (for testcases)
198 state FAKE_OUTPUTS:
199   outputs = string
200       -> call cfg_fake_outputs($outputs)
201
202 # force_display_urgency_hint <timeout> ms
203 state FORCE_DISPLAY_URGENCY_HINT:
204   duration_ms = number
205       -> FORCE_DISPLAY_URGENCY_HINT_MS
206
207 state FORCE_DISPLAY_URGENCY_HINT_MS:
208   'ms'
209       ->
210   end
211       -> call cfg_force_display_urgency_hint(&duration_ms)
212
213 # workspace <workspace> output <output>
214 state WORKSPACE:
215   workspace = word
216     -> WORKSPACE_OUTPUT
217
218 state WORKSPACE_OUTPUT:
219   'output'
220       -> WORKSPACE_OUTPUT_STR
221
222 state WORKSPACE_OUTPUT_STR:
223   output = word
224       -> call cfg_workspace($workspace, $output)
225
226 # ipc-socket <path>
227 state IPC_SOCKET:
228   path = string
229       -> call cfg_ipc_socket($path)
230
231 # restart_state <path> (for testcases)
232 state RESTART_STATE:
233   path = string
234       -> call cfg_restart_state($path)
235
236 # popup_during_fullscreen
237 state POPUP_DURING_FULLSCREEN:
238   value = 'ignore', 'leave_fullscreen', 'smart'
239       -> call cfg_popup_during_fullscreen($value)
240
241 # client.background <hexcolor>
242 state COLOR_SINGLE:
243   color = word
244       -> call cfg_color_single($colorclass, $color)
245
246 # colorclass border background text indicator
247 state COLOR_BORDER:
248   border = word
249       -> COLOR_BACKGROUND
250
251 state COLOR_BACKGROUND:
252   background = word
253       -> COLOR_TEXT
254
255 state COLOR_TEXT:
256   text = word
257       -> COLOR_INDICATOR
258
259 state COLOR_INDICATOR:
260   indicator = word
261       -> call cfg_color($colorclass, $border, $background, $text, $indicator)
262   end
263       -> call cfg_color($colorclass, $border, $background, $text, NULL)
264
265 # <exec|exec_always> [--no-startup-id] command
266 state EXEC:
267   no_startup_id = '--no-startup-id'
268       ->
269   command = string
270       -> call cfg_exec($exectype, $no_startup_id, $command)
271
272 # font font
273 state FONT:
274   font = string
275       -> call cfg_font($font)
276
277 # bindsym/bindcode
278 state BINDING:
279   release = '--release'
280       ->
281   whole_window = '--whole-window'
282       ->
283   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
284       ->
285   '+'
286       ->
287   key = word
288       -> BINDCOMMAND
289
290 state BINDCOMMAND:
291   release = '--release'
292       ->
293   whole_window = '--whole-window'
294       ->
295   command = string
296       -> call cfg_binding($bindtype, $modifiers, $key, $release, $whole_window, $command)
297
298 ################################################################################
299 # Mode configuration
300 ################################################################################
301
302 state MODENAME:
303   modename = word
304       -> call cfg_enter_mode($modename); MODEBRACE
305
306 state MODEBRACE:
307   end
308       ->
309   '{'
310       -> MODE
311
312 state MODE:
313   end ->
314   error ->
315   '#' -> MODE_IGNORE_LINE
316   'set' -> MODE_IGNORE_LINE
317   bindtype = 'bindsym', 'bindcode', 'bind'
318       -> MODE_BINDING
319   '}'
320       -> INITIAL
321
322 # We ignore comments and 'set' lines (variables).
323 state MODE_IGNORE_LINE:
324   line
325       -> MODE
326
327 state MODE_BINDING:
328   release = '--release'
329       ->
330   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
331       ->
332   '+'
333       ->
334   key = word
335       -> MODE_BINDCOMMAND
336
337 state MODE_BINDCOMMAND:
338   release = '--release'
339       ->
340   whole_window = '--whole-window'
341       ->
342   command = string
343       -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $whole_window, $command); MODE
344
345 ################################################################################
346 # Bar configuration (i3bar)
347 ################################################################################
348
349 state BARBRACE:
350   end
351       ->
352   '{'
353       -> BAR
354
355 state BAR:
356   end ->
357   error ->
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
363   'mode'                   -> BAR_MODE
364   'hidden_state'           -> BAR_HIDDEN_STATE
365   'id'                     -> BAR_ID
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
372   'font'                   -> BAR_FONT
373   'separator_symbol'       -> BAR_SEPARATOR_SYMBOL
374   'binding_mode_indicator' -> BAR_BINDING_MODE_INDICATOR
375   'workspace_buttons'      -> BAR_WORKSPACE_BUTTONS
376   'strip_workspace_numbers' -> BAR_STRIP_WORKSPACE_NUMBERS
377   'verbose'                -> BAR_VERBOSE
378   'colors'                 -> BAR_COLORS_BRACE
379   '}'
380       -> call cfg_bar_finish(); INITIAL
381
382 # We ignore comments and 'set' lines (variables).
383 state BAR_IGNORE_LINE:
384   line
385       -> BAR
386
387 state BAR_BAR_COMMAND:
388   command = string
389       -> call cfg_bar_i3bar_command($command); BAR
390
391 state BAR_STATUS_COMMAND:
392   command = string
393       -> call cfg_bar_status_command($command); BAR
394
395 state BAR_SOCKET_PATH:
396   path = string
397       -> call cfg_bar_socket_path($path); BAR
398
399 state BAR_MODE:
400   mode = 'dock', 'hide', 'invisible'
401       -> call cfg_bar_mode($mode); BAR
402
403 state BAR_HIDDEN_STATE:
404   hidden_state = 'hide', 'show'
405       -> call cfg_bar_hidden_state($hidden_state); BAR
406
407 state BAR_ID:
408   bar_id = word
409       -> call cfg_bar_id($bar_id); BAR
410
411 state BAR_MODIFIER:
412   modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
413       -> call cfg_bar_modifier($modifier); BAR
414
415 state BAR_WHEEL_UP_CMD:
416   command = string
417       -> call cfg_bar_wheel_up_cmd($command); BAR
418
419 state BAR_WHEEL_DOWN_CMD:
420   command = string
421       -> call cfg_bar_wheel_down_cmd($command); BAR
422
423 state BAR_POSITION:
424   position = 'top', 'bottom'
425       -> call cfg_bar_position($position); BAR
426
427 state BAR_OUTPUT:
428   output = string
429       -> call cfg_bar_output($output); BAR
430
431 state BAR_TRAY_OUTPUT:
432   output = word
433       -> call cfg_bar_tray_output($output); BAR
434
435 state BAR_FONT:
436   font = string
437       -> call cfg_bar_font($font); BAR
438
439 state BAR_SEPARATOR_SYMBOL:
440   separator = string
441       -> call cfg_bar_separator_symbol($separator); BAR
442
443 state BAR_BINDING_MODE_INDICATOR:
444   value = word
445       -> call cfg_bar_binding_mode_indicator($value); BAR
446
447 state BAR_WORKSPACE_BUTTONS:
448   value = word
449       -> call cfg_bar_workspace_buttons($value); BAR
450
451 state BAR_STRIP_WORKSPACE_NUMBERS:
452   value = word
453       -> call cfg_bar_strip_workspace_numbers($value); BAR
454
455 state BAR_VERBOSE:
456   value = word
457       -> call cfg_bar_verbose($value); BAR
458
459 state BAR_COLORS_BRACE:
460   end
461       ->
462   '{'
463       -> BAR_COLORS
464
465 state BAR_COLORS:
466   end ->
467   '#' -> BAR_COLORS_IGNORE_LINE
468   'set' -> BAR_COLORS_IGNORE_LINE
469   colorclass = 'background', 'statusline', 'separator'
470       -> BAR_COLORS_SINGLE
471   colorclass = 'focused_workspace', 'active_workspace', 'inactive_workspace', 'urgent_workspace'
472       -> BAR_COLORS_BORDER
473   '}'
474       -> BAR
475
476 # We ignore comments and 'set' lines (variables).
477 state BAR_COLORS_IGNORE_LINE:
478   line
479       -> BAR_COLORS
480
481 state BAR_COLORS_SINGLE:
482   color = word
483       -> call cfg_bar_color_single($colorclass, $color); BAR_COLORS
484
485 state BAR_COLORS_BORDER:
486   border = word
487       -> BAR_COLORS_BACKGROUND
488
489 state BAR_COLORS_BACKGROUND:
490   background = word
491       -> BAR_COLORS_TEXT
492
493 state BAR_COLORS_TEXT:
494   end
495       -> call cfg_bar_color($colorclass, $border, $background, NULL); BAR_COLORS
496   text = word
497       -> call cfg_bar_color($colorclass, $border, $background, $text); BAR_COLORS