i3
configuration.h
Go to the documentation of this file.
1/*
2 * vim:ts=4:sw=4:expandtab
3 *
4 * i3 - an improved tiling window manager
5 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6 *
7 * include/configuration.h: Contains all structs/variables for the configurable
8 * part of i3 as well as functions handling the configuration file (calling
9 * the parser (src/config_parse.c) with the correct path, switching key
10 * bindings mode).
11 *
12 */
13#pragma once
14
15#include "queue.h"
16#include "i3.h"
17#include "tiling_drag.h"
18
20typedef struct Config Config;
21typedef struct Barconfig Barconfig;
22extern char *current_configpath;
23extern char *current_config;
24extern Config config;
25extern SLIST_HEAD(modes_head, Mode) modes;
26extern TAILQ_HEAD(barconfig_head, Barconfig) barconfigs;
27extern TAILQ_HEAD(includedfiles_head, IncludedFile) included_files;
28
34struct context {
37
39 char *line_copy;
40 const char *filename;
41
43
44 /* These are the same as in YYLTYPE */
47};
48
61
67struct Variable {
68 char *key;
69 char *value;
71
73};
74
86
93struct Mode {
94 char *name;
96 struct bindings_head *bindings;
97
99};
100
106struct Config {
107 const char *terminal;
109
112
118
121
127
137
143
149
168
178
181
184
190
197
199 enum {
200 /* Focus if the target workspace is visible, set urgency hint otherwise. */
202 /* Always set the urgency hint. */
204 /* Always focus the window. */
206 /* Ignore the request (no focus, no urgency hint). */
209
213
215 enum {
220
223
226
233
239
240 /* Color codes are stored here */
256
258 enum {
259 /* display (and focus) the popup when it belongs to the fullscreen
260 * window only. */
262
263 /* leave fullscreen mode unconditionally */
265
266 /* just ignore the popup, that is, don’t map it */
268
269 /* display all floating windows */
272
273 /* The number of currently parsed barconfigs */
275
277
278 /* Gap sizes */
280
281 /* Disable gaps if there is only one container on the workspace */
283};
284
290struct Barconfig {
293 char *id;
294
299 char **outputs;
300
301 /* List of outputs on which the tray is allowed to be shown, in order.
302 * The special value "none" disables it (per default, it will be shown) and
303 * the special value "primary" enabled it on the primary output. */
304 TAILQ_HEAD(tray_outputs_head, tray_output_t) tray_outputs;
305
306 /* Padding around the tray icons. */
308
313
315 enum { M_DOCK = 0,
318
319 /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
320 enum { S_HIDE = 0,
322
324 uint32_t modifier;
325
326 TAILQ_HEAD(bar_bindings_head, Barbinding) bar_bindings;
327
329 enum { P_BOTTOM = 0,
331
336
340
344
346 char *font;
347
350
355
358
362
366
370
373
375 uint32_t bar_height;
376
377 struct Rect padding;
378
408
410};
411
429
431 char *output;
432
434};
435
441
453bool load_configuration(const char *override_configfile, config_load_t load_type);
454
460void ungrab_all_keys(xcb_connection_t *conn);
struct includedfiles_head included_files
Definition config.c:22
struct barconfig_head barconfigs
Definition config.c:21
struct modes_head modes
Definition config.c:20
xcb_connection_t * conn
XCB connection and root screen.
Definition main.c:54
struct bindings_head * bindings
Definition main.c:87
Config config
Definition config.c:19
config_load_t
@ C_VALIDATE
@ C_RELOAD
@ C_LOAD
bool load_configuration(const char *override_configfile, config_load_t load_type)
(Re-)loads the configuration file (sets useful defaults before).
Definition config.c:169
char * current_configpath
Definition config.c:18
char * current_config
void ungrab_all_keys(xcb_connection_t *conn)
Ungrabs all keys, to be called before re-grabbing the keys because of a mapping_notify event or a con...
Definition config.c:29
hide_edge_borders_mode_t
Definition data.h:88
smart_gaps_t
Definition data.h:84
warping_t
Mouse pointer warping modes.
Definition data.h:141
layout_t
Container layouts.
Definition data.h:101
focus_wrapping_t
Focus wrapping modes.
Definition data.h:168
border_style_t
Definition data.h:65
#define TAILQ_HEAD(name, type)
Definition queue.h:318
#define SLIST_HEAD(name, type)
Definition queue.h:93
tiling_drag_t
Tiling drag initiation modes.
Definition tiling_drag.h:17
Used during the config file lexing/parsing to keep the state of the lexer in order to provide useful ...
char * line_copy
bool has_warnings
int last_column
int line_number
int first_column
bool has_errors
const char * filename
char * compact_error
Part of the struct Config.
color_t border
color_t child_border
color_t indicator
color_t background
Holds a user-assigned variable for parsing the configuration file.
char * key
char * next_match
char * value
SLIST_ENTRY(Variable) variables
List entry struct for an included file.
char * variable_replaced_contents
char * raw_contents
TAILQ_ENTRY(IncludedFile) files
The configuration file can contain multiple sets of bindings.
char * name
struct bindings_head * bindings
bool pango_markup
SLIST_ENTRY(Mode) modes
Holds part of the configuration (the part which is not already in dedicated structures in include/dat...
int container_stack_limit_value
enum Config::@6 popup_during_fullscreen
What should happen when a new popup is opened during fullscreen mode.
focus_wrapping_t focus_wrapping
When focus wrapping is enabled (the default), attempting to move focus past the edge of the screen (i...
gaps_t gaps
char * restart_state_path
bool workspace_auto_back_and_forth
Automatic workspace back and forth switching.
tiling_drag_t tiling_drag
int32_t floating_minimum_width
uint32_t swap_modifier
The modifier which needs to be pressed in combination with the floating modifier and your mouse butto...
enum Config::@5 title_align
Title alignment options.
int default_border_width
i3Font font
hide_edge_borders_mode_t hide_edge_borders
Remove borders if they are adjacent to the screen edge.
int32_t floating_minimum_height
const char * terminal
bool disable_focus_follows_mouse
By default, focus follows mouse.
struct Config::config_client client
warping_t mouse_warping
By default, when switching focus to a window on a different output (e.g.
smart_gaps_t smart_gaps
char * fake_outputs
Overwrites output detection (for testing), see src/fake_outputs.c.
int default_floating_border_width
int default_orientation
Default orientation for new containers.
uint32_t floating_modifier
The modifier which needs to be pressed in combination with your mouse buttons to do things with float...
char * ipc_socket_path
bool show_marks
Specifies whether or not marks should be displayed in the window decoration.
float workspace_urgency_timer
By default, urgency is cleared immediately when switching to another workspace leads to focusing the ...
int container_stack_limit
struct Config::config_bar bar
bool disable_randr15
Don’t use RandR 1.5 for querying outputs.
enum Config::@4 focus_on_window_activation
Behavior when a window sends a NET_ACTIVE_WINDOW message.
int32_t floating_maximum_width
Maximum and minimum dimensions of a floating window.
bool force_xinerama
By default, use the RandR API for multi-monitor setups.
int32_t floating_maximum_height
border_style_t default_border
The default border style for new windows.
bool disable_workspace_bar
By default, a workspace bar is drawn at the bottom of the screen.
layout_t default_layout
border_style_t default_floating_border
The default border style for new floating windows.
@ PDF_LEAVE_FULLSCREEN
int number_barconfigs
struct Colortriple focused
struct Colortriple placeholder
struct Colortriple focused_tab_title
struct Colortriple unfocused
struct Colortriple urgent
struct Colortriple focused_inactive
struct Colortriple focused
struct Colortriple unfocused
struct Colortriple urgent
Holds the status bar configuration (i3bar).
struct Rect padding
bool hide_workspace_buttons
Hide workspace buttons? Configuration option is 'workspace_buttons no' but we invert the bool to get ...
char * separator_symbol
A custom separator to use instead of a vertical line.
int workspace_min_width
The minimal width for workspace buttons.
struct Barconfig::bar_colors colors
uint32_t modifier
Bar modifier (to show bar when in hide mode).
uint32_t bar_height
Defines the height of the bar in pixels.
char * i3bar_command
Command that should be run to execute i3bar, give a full path if i3bar is not in your $PATH.
int num_outputs
Number of outputs in the outputs array.
enum Barconfig::@8 hidden_state
char * font
Font specification for all text rendered on the bar.
TAILQ_HEAD(tray_outputs_head, tray_output_t) tray_outputs
char * id
Automatically generated ID for this bar config.
TAILQ_HEAD(bar_bindings_head, Barbinding) bar_bindings
enum Barconfig::@7 mode
Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mo...
char * workspace_command
Command that should be run to get the workspace buttons.
bool hide_binding_mode_indicator
Hide mode button? Configuration option is 'binding_mode_indicator no' but we invert the bool for the ...
char * status_command
Command that should be run to get a statusline, for example 'i3status'.
bool strip_workspace_numbers
Strip workspace numbers? Configuration option is 'strip_workspace_numbers yes'.
bool strip_workspace_name
Strip workspace name? Configuration option is 'strip_workspace_name yes'.
char ** outputs
Outputs on which this bar should show up on.
TAILQ_ENTRY(Barconfig) configs
enum Barconfig::@9 position
Bar position (bottom by default).
char * socket_path
Path to the i3 IPC socket.
bool verbose
Enable verbose mode? Useful for debugging purposes.
Defines a mouse command to be executed instead of the default behavior when clicking on the non-statu...
bool release
If true, the command will be executed after the button is released.
TAILQ_ENTRY(Barbinding) bindings
int input_code
The button to be used (e.g., 1 for "button1").
char * command
The command which is to be executed for this button.
TAILQ_ENTRY(tray_output_t) tray_outputs
Definition data.h:146
Stores a rectangle, for example the size of a window, the child window etc.
Definition data.h:185
Data structure for cached font information:
Definition libi3.h:59