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