i3
config.c
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * config.c: Configuration file (calling the parser (src/config_parser.c) with
8  * the correct path, switching key bindings mode).
9  *
10  */
11 #include "all.h"
12 
13 #include <libgen.h>
14 #include <unistd.h>
15 
16 #include <xkbcommon/xkbcommon.h>
17 
18 char *current_configpath = NULL;
20 struct modes_head modes;
21 struct barconfig_head barconfigs = TAILQ_HEAD_INITIALIZER(barconfigs);
22 struct includedfiles_head included_files = TAILQ_HEAD_INITIALIZER(included_files);
23 
24 /*
25  * Ungrabs all keys, to be called before re-grabbing the keys because of a
26  * mapping_notify event or a configuration file reload
27  *
28  */
29 void ungrab_all_keys(xcb_connection_t *conn) {
30  DLOG("Ungrabbing all keys\n");
31  xcb_ungrab_key(conn, XCB_GRAB_ANY, root, XCB_BUTTON_MASK_ANY);
32 }
33 
34 static void free_configuration(void) {
35  assert(conn != NULL);
36 
37  /* If we are currently in a binding mode, we first revert to the default
38  * since we have no guarantee that the current mode will even still exist
39  * after parsing the config again. See #2228. */
40  switch_mode("default");
41 
42  /* First ungrab the keys */
44 
45  struct Mode *mode;
46  while (!SLIST_EMPTY(&modes)) {
47  mode = SLIST_FIRST(&modes);
48  FREE(mode->name);
49 
50  /* Clear the old binding list */
51  while (!TAILQ_EMPTY(mode->bindings)) {
52  Binding *bind = TAILQ_FIRST(mode->bindings);
53  TAILQ_REMOVE(mode->bindings, bind, bindings);
54  binding_free(bind);
55  }
56  FREE(mode->bindings);
57 
58  SLIST_REMOVE(&modes, mode, Mode, modes);
59  FREE(mode);
60  }
61 
62  while (!TAILQ_EMPTY(&assignments)) {
63  struct Assignment *assign = TAILQ_FIRST(&assignments);
64  if (assign->type == A_TO_WORKSPACE || assign->type == A_TO_WORKSPACE_NUMBER)
65  FREE(assign->dest.workspace);
66  else if (assign->type == A_COMMAND)
67  FREE(assign->dest.command);
68  else if (assign->type == A_TO_OUTPUT)
69  FREE(assign->dest.output);
70  match_free(&(assign->match));
72  FREE(assign);
73  }
74 
75  while (!TAILQ_EMPTY(&ws_assignments)) {
77  FREE(assign->name);
78  FREE(assign->output);
80  FREE(assign);
81  }
82 
83  /* Clear bar configs */
84  Barconfig *barconfig;
85  while (!TAILQ_EMPTY(&barconfigs)) {
86  barconfig = TAILQ_FIRST(&barconfigs);
87  FREE(barconfig->id);
88  for (int c = 0; c < barconfig->num_outputs; c++)
89  free(barconfig->outputs[c]);
90 
91  while (!TAILQ_EMPTY(&(barconfig->bar_bindings))) {
92  struct Barbinding *binding = TAILQ_FIRST(&(barconfig->bar_bindings));
93  FREE(binding->command);
94  TAILQ_REMOVE(&(barconfig->bar_bindings), binding, bindings);
95  FREE(binding);
96  }
97 
98  while (!TAILQ_EMPTY(&(barconfig->tray_outputs))) {
99  struct tray_output_t *tray_output = TAILQ_FIRST(&(barconfig->tray_outputs));
100  FREE(tray_output->output);
101  TAILQ_REMOVE(&(barconfig->tray_outputs), tray_output, tray_outputs);
102  FREE(tray_output);
103  }
104 
105  FREE(barconfig->outputs);
106  FREE(barconfig->socket_path);
107  FREE(barconfig->status_command);
108  FREE(barconfig->workspace_command);
109  FREE(barconfig->i3bar_command);
110  FREE(barconfig->font);
111  FREE(barconfig->colors.background);
112  FREE(barconfig->colors.statusline);
113  FREE(barconfig->colors.separator);
114  FREE(barconfig->colors.focused_background);
115  FREE(barconfig->colors.focused_statusline);
116  FREE(barconfig->colors.focused_separator);
118  FREE(barconfig->colors.focused_workspace_bg);
119  FREE(barconfig->colors.focused_workspace_text);
120  FREE(barconfig->colors.active_workspace_border);
121  FREE(barconfig->colors.active_workspace_bg);
122  FREE(barconfig->colors.active_workspace_text);
124  FREE(barconfig->colors.inactive_workspace_bg);
125  FREE(barconfig->colors.inactive_workspace_text);
126  FREE(barconfig->colors.urgent_workspace_border);
127  FREE(barconfig->colors.urgent_workspace_bg);
128  FREE(barconfig->colors.urgent_workspace_text);
129  FREE(barconfig->colors.binding_mode_border);
130  FREE(barconfig->colors.binding_mode_bg);
131  FREE(barconfig->colors.binding_mode_text);
132  TAILQ_REMOVE(&barconfigs, barconfig, configs);
133  FREE(barconfig);
134  }
135 
136  Con *con;
137  TAILQ_FOREACH (con, &all_cons, all_cons) {
138  /* Assignments changed, previously ran assignments are invalid. */
139  if (con->window) {
140  con->window->nr_assignments = 0;
141  FREE(con->window->ran_assignments);
142  }
143  /* Invalidate pixmap caches in case font or colors changed. */
144  FREE(con->deco_render_params);
145  }
146 
147  /* Get rid of the current font */
148  free_font();
149 
150  free(config.ipc_socket_path);
152  free(config.fake_outputs);
153 }
154 
155 /*
156  * (Re-)loads the configuration file (sets useful defaults before).
157  *
158  * If you specify override_configpath, only this path is used to look for a
159  * configuration file.
160  *
161  * load_type specifies the type of loading: C_VALIDATE is used to only verify
162  * the correctness of the config file (used with the flag -C). C_LOAD will load
163  * the config for normal use and display errors in the nagbar. C_RELOAD will
164  * also clear the previous config.
165  *
166  */
167 bool load_configuration(const char *override_configpath, config_load_t load_type) {
168  if (load_type == C_RELOAD) {
170  }
171 
172  SLIST_INIT(&modes);
173 
174  struct Mode *default_mode = scalloc(1, sizeof(struct Mode));
175  default_mode->name = sstrdup("default");
176  default_mode->bindings = scalloc(1, sizeof(struct bindings_head));
177  TAILQ_INIT(default_mode->bindings);
178  SLIST_INSERT_HEAD(&modes, default_mode, modes);
179 
180  bindings = default_mode->bindings;
181  current_binding_mode = default_mode->name;
182 
183  /* Clear the old config or initialize the data structure */
184  memset(&config, 0, sizeof(config));
185 
186  /* Initialize default colors */
187 #define INIT_COLOR(x, cborder, cbackground, ctext, cindicator) \
188  do { \
189  x.border = draw_util_hex_to_color(cborder); \
190  x.background = draw_util_hex_to_color(cbackground); \
191  x.text = draw_util_hex_to_color(ctext); \
192  x.indicator = draw_util_hex_to_color(cindicator); \
193  x.child_border = draw_util_hex_to_color(cbackground); \
194  } while (0)
195 
196 // config.client.got_focused_tab_title = false;
199  "#f7f7f7", "#f5f5f5", "#000000", "#0a0a0a");
201  "#f7f7f7", "#dcdcdc", "#191919", "#232323");
203  "#f7f7f7", "#c4c4c4", "#323232", "#3b3b3b");
205  "#bd2727", "#e79e27", "#333333", "#27bdbd");
206 
209  "#d06767", "#bd2727", "#ffffff", "#27bdbd");
211  "#d06767", "#971f1f", "#e5e5e5", "#1f9797");
213  "#d06767", "#841b1b", "#cccccc", "#1b8484");
215  "#bd2727", "#e79e27", "#333333", "#27bdbd");
216 
219  "#eebb67", "#e79e27", "#000000", "#2770e7");
221  "#eebb67", "#b87e1f", "#191919", "#1f59b8");
223  "#eebb67", "#a16e1b", "#323232", "#1b4ea1");
225  "#bd2727", "#e79e27", "#333333", "#27bdbd");
226 
229  "#eeec6f", "#e7e532", "#000000", "#3234e7");
231  "#eeec6f", "#b8b728", "#191919", "#2829b8");
233  "#eeec6f", "#a1a023", "#323232", "#2324a1");
235  "#bd2727", "#e79e27", "#333333", "#27bdbd");
236 
239  "#8be379", "#5ad840", "#000000", "#be40d8");
241  "#8be379", "#48ac33", "#191919", "#9833ac");
243  "#8be379", "#3e972c", "#323232", "#852c97");
245  "#bd2727", "#e79e27", "#333333", "#27bdbd");
246 
249  "#afafb4", "#8e8e95", "#ffffff", "#95958e");
251  "#afafb4", "#717177", "#e5e5e5", "#777771");
253  "#afafb4", "#636368", "#cccccc", "#686863");
255  "#bd2727", "#e79e27", "#333333", "#27bdbd");
256 
259  "#739de3", "#3874d8", "#ffffff", "#d89c38");
261  "#739de3", "#2c5cac", "#e5e5e5", "#ac7c2c");
263  "#739de3", "#275197", "#cccccc", "#976d27");
265  "#bd2727", "#e79e27", "#333333", "#27bdbd");
266 
269  "#bb73bb", "#9f389f", "#ffffff", "#389f38");
271  "#bb73bb", "#7f2c7f", "#e5e5e5", "#2c7f2c");
273  "#bb73bb", "#6f276f", "#cccccc", "#276f27");
275  "#bd2727", "#e79e27", "#333333", "#27bdbd");
276 
279  "#5b5b5b", "#333333", "#ffffff", "#cccccc");
281  "#5b5b5b", "#1e1e1e", "#e5e5e5", "#e1e1e1");
283  "#5b5b5b", "#141414", "#cccccc", "#ebebeb");
285  "#bd2727", "#e79e27", "#333333", "#27bdbd");
286 
287  /* border and indicator color are ignored for placeholder contents */
288  INIT_COLOR(config.client[QUBE_DOM0].placeholder,"#000000", "#0c0c0c", "#ffffff", "#000000");
289 
290  /* the last argument (indicator color) is ignored for bar colors */
291  INIT_COLOR(config.bar.focused, "#4c7899", "#285577", "#ffffff", "#000000");
292  INIT_COLOR(config.bar.unfocused, "#333333", "#222222", "#888888", "#000000");
293  INIT_COLOR(config.bar.urgent, "#2f343a", "#900000", "#ffffff", "#000000");
294 
295  config.show_marks = true;
296 
301  /* Set default_orientation to NO_ORIENTATION for auto orientation. */
303 
304  config.gaps.inner = 0;
305  config.gaps.top = 0;
306  config.gaps.right = 0;
307  config.gaps.bottom = 0;
308  config.gaps.left = 0;
309 
310  /* Set default urgency reset delay to 500ms */
313 
315 
317 
319  current_configpath = get_config_path(override_configpath, true);
320  if (current_configpath == NULL) {
321  die("Unable to find the configuration file (looked at "
322  "$XDG_CONFIG_HOME/i3/config, ~/.i3/config, $XDG_CONFIG_DIRS/i3/config "
323  "and " SYSCONFDIR "/i3/config)");
324  }
325 
326  IncludedFile *file;
327  while (!TAILQ_EMPTY(&included_files)) {
328  file = TAILQ_FIRST(&included_files);
329  FREE(file->path);
330  FREE(file->raw_contents);
332  TAILQ_REMOVE(&included_files, file, files);
333  FREE(file);
334  }
335 
336  char resolved_path[PATH_MAX] = {'\0'};
337  if (realpath(current_configpath, resolved_path) == NULL) {
338  die("realpath(%s): %s", current_configpath, strerror(errno));
339  }
340 
341  file = scalloc(1, sizeof(IncludedFile));
342  file->path = sstrdup(resolved_path);
343  TAILQ_INSERT_TAIL(&included_files, file, files);
344 
345  LOG("Parsing configfile %s\n", resolved_path);
346  struct stack stack;
347  memset(&stack, '\0', sizeof(struct stack));
348  struct parser_ctx ctx = {
349  .use_nagbar = (load_type != C_VALIDATE),
350  .assume_v4 = false,
351  .stack = &stack,
352  };
353  SLIST_INIT(&(ctx.variables));
354  const int result = parse_file(&ctx, resolved_path, file);
356  if (result == -1) {
357  die("Could not open configuration file: %s\n", strerror(errno));
358  }
359 
362 
363  if (config.font.type == FONT_TYPE_NONE && load_type != C_VALIDATE) {
364  ELOG("You did not specify required configuration option \"font\"\n");
365  config.font = load_font("fixed", true);
366  set_font(&config.font);
367  }
368 
369  /* redefine defaults, to overwrite user settings easily */
374 
375  /* Make bar config blocks without a configured font use the i3-wide font. */
376  Barconfig *current;
377  if (load_type != C_VALIDATE) {
378  TAILQ_FOREACH (current, &barconfigs, configs) {
379  if (current->font != NULL) {
380  continue;
381  }
382  current->font = sstrdup(config.font.pattern);
383  }
384  }
385 
386  if (load_type == C_RELOAD) {
391 
392  /* Redraw the currently visible decorations on reload, so that the
393  * possibly new drawing parameters changed. */
394  tree_render();
395  }
396 
397  return result == 0;
398 }
Assignment::A_TO_OUTPUT
@ A_TO_OUTPUT
Definition: data.h:640
Mode::bindings
struct bindings_head * bindings
Definition: configuration.h:96
SLIST_INSERT_HEAD
#define SLIST_INSERT_HEAD(head, elm, field)
Definition: queue.h:138
Assignment::type
enum Assignment::@16 type
type of this assignment:
Barconfig::num_outputs
int num_outputs
Number of outputs in the outputs array.
Definition: configuration.h:293
Assignment::A_COMMAND
@ A_COMMAND
Definition: data.h:636
Config::config_client::urgent
struct Colortriple urgent
Definition: configuration.h:244
Config::config_bar::focused
struct Colortriple focused
Definition: configuration.h:249
parser_ctx
Definition: config_parser.h:36
Config::config_client::placeholder
struct Colortriple placeholder
Definition: configuration.h:245
TAILQ_INIT
#define TAILQ_INIT(head)
Definition: queue.h:360
extract_workspace_names_from_bindings
void extract_workspace_names_from_bindings(void)
Extracts workspace names from keybindings (e.g.
Definition: workspace.c:181
Barconfig::bar_colors::focused_workspace_text
char * focused_workspace_text
Definition: configuration.h:387
QUBE_YELLOW
@ QUBE_YELLOW
Definition: data.h:186
Barconfig::bar_colors::urgent_workspace_border
char * urgent_workspace_border
Definition: configuration.h:397
all.h
Barconfig::socket_path
char * socket_path
Path to the i3 IPC socket.
Definition: configuration.h:309
TAILQ_HEAD_INITIALIZER
#define TAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:324
Mode::name
char * name
Definition: configuration.h:94
Config::config_client::focused
struct Colortriple focused
Definition: configuration.h:240
Assignment::match
Match match
the criteria to check if a window matches
Definition: data.h:644
root
xcb_window_t root
Definition: main.c:67
Binding
Holds a keybinding, consisting of a keycode combined with modifiers and the command which is executed...
Definition: data.h:328
stack
Definition: config_parser.h:32
TAILQ_REMOVE
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:402
QUBE_RED
@ QUBE_RED
Definition: data.h:184
Barconfig::bar_colors::focused_statusline
char * focused_statusline
Definition: configuration.h:382
included_files
struct includedfiles_head included_files
Definition: config.c:22
parse_file
parse_file_result_t parse_file(struct parser_ctx *ctx, const char *f, IncludedFile *included_file)
Parses the given file by first replacing the variables, then calling parse_config and launching i3-na...
Definition: config_parser.c:853
Con::window
struct Window * window
Definition: data.h:746
Barconfig::i3bar_command
char * i3bar_command
Command that should be run to execute i3bar, give a full path if i3bar is not in your $PATH.
Definition: configuration.h:332
Config::config_client::focused_inactive
struct Colortriple focused_inactive
Definition: configuration.h:241
Barconfig::bar_colors::focused_workspace_bg
char * focused_workspace_bg
Definition: configuration.h:386
Assignment::dest
union Assignment::@17 dest
destination workspace/command/output, depending on the type
Barconfig::colors
struct Barconfig::bar_colors colors
current_configpath
char * current_configpath
Definition: config.c:18
ctx
static xcb_cursor_context_t * ctx
Definition: xcursor.c:19
FREE
#define FREE(pointer)
Definition: util.h:47
Barconfig::bar_colors::active_workspace_bg
char * active_workspace_bg
Definition: configuration.h:390
gaps_t::top
int top
Definition: data.h:152
Barconfig::bar_colors::inactive_workspace_text
char * inactive_workspace_text
Definition: configuration.h:395
SLIST_FIRST
#define SLIST_FIRST(head)
Definition: queue.h:109
Font::pattern
char * pattern
The pattern/name used to load the font.
Definition: libi3.h:71
current_binding_mode
const char * current_binding_mode
Definition: main.c:88
get_config_path
char * get_config_path(const char *override_configpath, bool use_system_paths)
Get the path of the first configuration file found.
QUBE_BLUE
@ QUBE_BLUE
Definition: data.h:189
Window::ran_assignments
Assignment ** ran_assignments
Definition: data.h:457
Workspace_Assignment
Stores which workspace (by name or number) goes to which output and its gaps config.
Definition: data.h:257
QUBE_GRAY
@ QUBE_GRAY
Definition: data.h:188
Con
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition: data.h:671
Config::fake_outputs
char * fake_outputs
Overwrites output detection (for testing), see src/fake_outputs.c.
Definition: configuration.h:183
Barconfig::bar_colors::active_workspace_border
char * active_workspace_border
Definition: configuration.h:389
bindings
struct bindings_head * bindings
Definition: main.c:87
BS_NORMAL
@ BS_NORMAL
Definition: data.h:68
free_variables
void free_variables(struct parser_ctx *ctx)
Releases the memory of all variables in ctx.
Definition: config_parser.c:837
Config::show_marks
bool show_marks
Specifies whether or not marks should be displayed in the window decoration.
Definition: configuration.h:212
TAILQ_INSERT_TAIL
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:376
Config::workspace_urgency_timer
float workspace_urgency_timer
By default, urgency is cleared immediately when switching to another workspace leads to focusing the ...
Definition: configuration.h:196
Config::default_orientation
int default_orientation
Default orientation for new containers.
Definition: configuration.h:120
QUBE_PURPLE
@ QUBE_PURPLE
Definition: data.h:190
Assignment::A_TO_WORKSPACE_NUMBER
@ A_TO_WORKSPACE_NUMBER
Definition: data.h:639
Barconfig::workspace_command
char * workspace_command
Command that should be run to get the workspace buttons.
Definition: configuration.h:340
Config::config_bar::unfocused
struct Colortriple unfocused
Definition: configuration.h:250
Config::font
i3Font font
Definition: configuration.h:108
Barconfig::font
char * font
Font specification for all text rendered on the bar.
Definition: configuration.h:343
LOG
#define LOG(fmt,...)
Definition: libi3.h:95
Barconfig::id
char * id
Automatically generated ID for this bar config.
Definition: configuration.h:290
Config::config_client::unfocused
struct Colortriple unfocused
Definition: configuration.h:243
QUBE_BLACK
@ QUBE_BLACK
Definition: data.h:191
QUBE_DOM0
@ QUBE_DOM0
Definition: data.h:183
Barconfig::bar_colors::binding_mode_bg
char * binding_mode_bg
Definition: configuration.h:402
Barconfig::bar_colors::active_workspace_text
char * active_workspace_text
Definition: configuration.h:391
translate_keysyms
void translate_keysyms(void)
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition: bindings.c:434
gaps_t::inner
int inner
Definition: data.h:151
sstrdup
char * sstrdup(const char *str)
Safe-wrapper around strdup which exits if malloc returns NULL (meaning that there is no more memory a...
Assignment::A_TO_WORKSPACE
@ A_TO_WORKSPACE
Definition: data.h:637
Config::default_floating_border_width
int default_floating_border_width
Definition: configuration.h:117
free_font
void free_font(void)
Frees the resources taken by the current font.
Barconfig::status_command
char * status_command
Command that should be run to get a statusline, for example 'i3status'.
Definition: configuration.h:336
binding_free
void binding_free(Binding *bind)
Frees the binding.
Definition: bindings.c:812
Font::type
enum Font::@21 type
The type of font.
Config::restart_state_path
char * restart_state_path
Definition: configuration.h:111
Barconfig::bar_colors::focused_workspace_border
char * focused_workspace_border
Definition: configuration.h:385
Window::nr_assignments
uint32_t nr_assignments
Pointers to the Assignments which were already ran for this Window (assignments run only once)
Definition: data.h:456
Assignment::command
char * command
Definition: data.h:648
IncludedFile::raw_contents
char * raw_contents
Definition: configuration.h:81
Workspace_Assignment::name
char * name
Definition: data.h:258
Config::tiling_drag
tiling_drag_t tiling_drag
Definition: configuration.h:270
Barconfig::bar_colors::inactive_workspace_bg
char * inactive_workspace_bg
Definition: configuration.h:394
Assignment::workspace
char * workspace
Definition: data.h:649
Barconfig::bar_colors::binding_mode_text
char * binding_mode_text
Definition: configuration.h:403
Config::config_bar::urgent
struct Colortriple urgent
Definition: configuration.h:251
ELOG
#define ELOG(fmt,...)
Definition: libi3.h:100
assignments
struct assignments_head assignments
Definition: main.c:97
TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:347
Barconfig
Holds the status bar configuration (i3bar).
Definition: configuration.h:287
tray_output_t::output
char * output
Definition: configuration.h:428
free_configuration
static void free_configuration(void)
Definition: config.c:34
SLIST_REMOVE
#define SLIST_REMOVE(head, elm, type, field)
Definition: queue.h:154
Workspace_Assignment::output
char * output
Definition: data.h:259
Barconfig::bar_colors::separator
char * separator
Definition: configuration.h:379
set_font
void set_font(i3Font *font)
Defines the font to be used for the forthcoming calls.
QUBE_ORANGE
@ QUBE_ORANGE
Definition: data.h:185
Barconfig::bar_colors::urgent_workspace_bg
char * urgent_workspace_bg
Definition: configuration.h:398
Barbinding::command
char * command
The command which is to be executed for this button.
Definition: configuration.h:419
NO_ORIENTATION
@ NO_ORIENTATION
Definition: data.h:60
scalloc
void * scalloc(size_t num, size_t size)
Safe-wrapper around calloc which exits if malloc returns NULL (meaning that there is no more memory a...
SLIST_INIT
#define SLIST_INIT(head)
Definition: queue.h:127
Barconfig::bar_colors::background
char * background
Definition: configuration.h:377
Config::ipc_socket_path
char * ipc_socket_path
Definition: configuration.h:110
Barconfig::bar_colors::binding_mode_border
char * binding_mode_border
Definition: configuration.h:401
IncludedFile
List entry struct for an included file.
Definition: configuration.h:79
Assignment
An Assignment makes specific windows go to a specific workspace/output or run a command for that wind...
Definition: data.h:622
Barbinding
Defines a mouse command to be executed instead of the default behavior when clicking on the non-statu...
Definition: configuration.h:414
gaps_t::bottom
int bottom
Definition: data.h:154
gaps_t::right
int right
Definition: data.h:153
all_cons
struct all_cons_head all_cons
Definition: tree.c:15
Config::default_border_width
int default_border_width
Definition: configuration.h:116
config
Config config
Definition: config.c:19
regrab_all_buttons
void regrab_all_buttons(xcb_connection_t *conn)
Release the button grabs on all managed windows and regrab them, reevaluating which buttons need to b...
Definition: bindings.c:179
Config::default_floating_border
border_style_t default_floating_border
The default border style for new floating windows.
Definition: configuration.h:225
load_font
i3Font load_font(const char *pattern, const bool fallback)
Loads a font for usage, also getting its height.
INIT_COLOR
#define INIT_COLOR(x, cborder, cbackground, ctext, cindicator)
switch_mode
void switch_mode(const char *new_mode)
Switches the key bindings to the given mode, if the mode exists.
Definition: bindings.c:620
Config::bar
struct Config::config_bar bar
config_load_t
config_load_t
Definition: configuration.h:433
ws_assignments
struct ws_assignments_head ws_assignments
Definition: main.c:101
Config
Holds part of the configuration (the part which is not already in dedicated structures in include/dat...
Definition: configuration.h:106
die
#define die(...)
Definition: util.h:19
gaps_reapply_workspace_assignments
void gaps_reapply_workspace_assignments(void)
Re-applies all workspace gap assignments to existing workspaces after reloading the configuration fil...
Definition: gaps.c:160
match_free
void match_free(Match *match)
Frees the given match.
Definition: match.c:276
Config::default_border
border_style_t default_border
The default border style for new windows.
Definition: configuration.h:222
draw_util_hex_to_color
color_t draw_util_hex_to_color(const char *color)
Parses the given color in hex format to an internal color representation.
ungrab_all_keys
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
TAILQ_EMPTY
#define TAILQ_EMPTY(head)
Definition: queue.h:344
parser_ctx::assume_v4
bool assume_v4
Definition: config_parser.h:38
Config::client
struct Config::config_client client[QUBE_NUM_LABELS]
Barconfig::bar_colors::focused_separator
char * focused_separator
Definition: configuration.h:383
TAILQ_FIRST
#define TAILQ_FIRST(head)
Definition: queue.h:336
modes
struct modes_head modes
Definition: config.c:20
tree_render
void tree_render(void)
Renders the tree, that is rendering all outputs using render_con() and pushing the changes to X11 usi...
Definition: tree.c:451
Assignment::output
char * output
Definition: data.h:650
barconfigs
struct barconfig_head barconfigs
Definition: config.c:21
C_RELOAD
@ C_RELOAD
Definition: configuration.h:436
load_configuration
bool load_configuration(const char *override_configpath, config_load_t load_type)
(Re-)loads the configuration file (sets useful defaults before).
Definition: config.c:167
SLIST_EMPTY
#define SLIST_EMPTY(head)
Definition: queue.h:111
Barconfig::bar_colors::urgent_workspace_text
char * urgent_workspace_text
Definition: configuration.h:399
Config::gaps
gaps_t gaps
Definition: configuration.h:273
TILING_DRAG_MODIFIER
@ TILING_DRAG_MODIFIER
Definition: tiling_drag.h:19
Config::focus_wrapping
focus_wrapping_t focus_wrapping
When focus wrapping is enabled (the default), attempting to move focus past the edge of the screen (i...
Definition: configuration.h:167
DLOG
#define DLOG(fmt,...)
Definition: libi3.h:105
IncludedFile::path
char * path
Definition: configuration.h:80
grab_all_keys
void grab_all_keys(xcb_connection_t *conn)
Grab the bound keys (tell X to send us keypress events for those keycodes)
Definition: bindings.c:149
Mode
The configuration file can contain multiple sets of bindings.
Definition: configuration.h:93
Con::deco_render_params
struct deco_render_params * deco_render_params
Cache for the decoration rendering.
Definition: data.h:752
C_VALIDATE
@ C_VALIDATE
Definition: configuration.h:434
gaps_t::left
int left
Definition: data.h:155
Barconfig::bar_colors::inactive_workspace_border
char * inactive_workspace_border
Definition: configuration.h:393
FOCUS_WRAPPING_ON
@ FOCUS_WRAPPING_ON
Definition: data.h:174
Barconfig::outputs
char ** outputs
Outputs on which this bar should show up on.
Definition: configuration.h:296
IncludedFile::variable_replaced_contents
char * variable_replaced_contents
Definition: configuration.h:82
tray_output_t
Definition: configuration.h:427
logical_px
int logical_px(const int logical)
Convert a logical amount of pixels (e.g.
Config::config_client::background
color_t background
Definition: configuration.h:239
Barconfig::bar_colors::statusline
char * statusline
Definition: configuration.h:378
conn
xcb_connection_t * conn
XCB connection and root screen.
Definition: main.c:54
Barconfig::bar_colors::focused_background
char * focused_background
Definition: configuration.h:381
reorder_bindings
void reorder_bindings(void)
Reorders bindings by event_state_mask descendingly so that get_binding() correctly matches more speci...
Definition: bindings.c:711
QUBE_GREEN
@ QUBE_GREEN
Definition: data.h:187