13 #include <xkbcommon/xkbcommon.h> 26 DLOG(
"Ungrabbing all keys\n");
27 xcb_ungrab_key(conn, XCB_GRAB_ANY,
root, XCB_BUTTON_MASK_ANY);
50 die(
"Unable to find the configuration file (looked at " 51 "~/.i3/config, $XDG_CONFIG_HOME/i3/config, " SYSCONFDIR
"/i3/config and $XDG_CONFIG_DIRS/i3/config)");
54 LOG(
"Parsing configfile %s\n", path);
59 if (!use_nagbar &&
bindings == NULL) {
128 TAILQ_REMOVE(&(barconfig->tray_outputs), tray_output, tray_outputs);
185 #define REQUIRED_OPTION(name) \ 186 if (config.name == NULL) \ 187 die("You did not specify required configuration option " #name "\n"); 190 memset(&config, 0,
sizeof(config));
193 #define INIT_COLOR(x, cborder, cbackground, ctext, cindicator) \ 195 x.border = draw_util_hex_to_color(cborder); \ 196 x.background = draw_util_hex_to_color(cbackground); \ 197 x.text = draw_util_hex_to_color(ctext); \ 198 x.indicator = draw_util_hex_to_color(cindicator); \ 199 x.child_border = draw_util_hex_to_color(cbackground); \ 237 if (config.
font.
type == FONT_TYPE_NONE) {
238 ELOG(
"You did not specify required configuration option \"font\"\n");
#define SLIST_FIRST(head)
#define TAILQ_EMPTY(head)
struct all_cons_head all_cons
char * status_command
Command that should be run to get a statusline, for example 'i3status'.
char * get_config_path(const char *override_configpath, bool use_system_paths)
Get the path of the first configuration file found.
struct Colortriple focused
union Assignment::@19 dest
destination workspace/command, depending on the type
int logical_px(const int logical)
Convert a logical amount of pixels (e.g.
struct bindings_head * bindings
char * focused_statusline
border_style_t default_border
The default border style for new windows.
char * command
The command which is to be executed for this button.
void switch_mode(const char *new_mode)
Switches the key bindings to the given mode, if the mode exists.
bool show_marks
Specifies whether or not marks should be displayed in the window decoration.
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...
char ** outputs
Outputs on which this bar should show up on.
The configuration file can contain multiple sets of bindings.
char * inactive_workspace_bg
An Assignment makes specific windows go to a specific workspace/output or run a command for that wind...
char * focused_background
enum Font::@23 type
The type of font.
char * socket_path
Path to the i3 IPC socket.
void update_barconfig()
Sends the current bar configuration as an event to all barconfig_update listeners.
border_style_t default_floating_border
The default border style for new floating windows.
i3Font load_font(const char *pattern, const bool fallback)
Loads a font for usage, also getting its height.
enum Assignment::@18 type
type of this assignment:
void ipc_send_barconfig_update_event(Barconfig *barconfig)
For the barconfig update events, we send the serialized barconfig.
void x_deco_recurse(Con *con)
Recursively calls x_draw_decoration.
struct Colortriple focused
char * focused_workspace_bg
struct Colortriple unfocused
struct Config::config_bar bar
char * urgent_workspace_border
struct bindings_head * bindings
char * urgent_workspace_text
char * urgent_workspace_bg
color_t draw_util_hex_to_color(const char *color)
Parses the given color in hex format to an internal color representation.
void binding_free(Binding *bind)
Frees the binding.
struct Colortriple urgent
#define TAILQ_HEAD_INITIALIZER(head)
char * active_workspace_border
struct Colortriple placeholder
bool parse_configuration(const char *override_configpath, bool use_nagbar)
Finds the configuration file to use (either the one specified by override_configpath), the user’s one or the system default) and calls parse_file().
struct Colortriple focused_inactive
void free_font(void)
Frees the resources taken by the current font.
A 'Con' represents everything from the X11 root window down to a single X11 window.
void translate_keysyms(void)
Translates keysymbols to keycodes for all bindings which use keysyms.
char * current_configpath
int default_floating_border_width
struct Colortriple urgent
#define TAILQ_REMOVE(head, elm, field)
Holds the status bar configuration (i3bar).
char * restart_state_path
#define TAILQ_FOREACH(var, head, field)
char * focused_workspace_text
char * focused_workspace_border
char * active_workspace_text
char * fake_outputs
Overwrites output detection (for testing), see src/fake_outputs.c.
void grab_all_keys(xcb_connection_t *conn)
Grab the bound keys (tell X to send us keypress events for those keycodes)
struct barconfig_head barconfigs
struct deco_render_params * deco_render_params
Cache for the decoration rendering.
float workspace_urgency_timer
By default, urgency is cleared immediately when switching to another workspace leads to focusing the ...
#define SLIST_EMPTY(head)
xcb_connection_t * conn
XCB connection and root screen.
char * font
Font specification for all text rendered on the bar.
int default_orientation
Default orientation for new containers.
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...
void match_free(Match *match)
Frees the given match.
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...
#define TAILQ_FIRST(head)
#define SLIST_REMOVE(head, elm, type, field)
int num_outputs
Number of outputs in the outputs array.
char * binding_mode_border
Match match
the criteria to check if a window matches
char * active_workspace_bg
char * inactive_workspace_text
Holds part of the configuration (the part which is not already in dedicated structures in include/dat...
struct Config::config_client client
bool parse_file(const char *f, bool use_nagbar)
Parses the given file by first replacing the variables, then calling parse_config and launching i3-na...
struct Colortriple unfocused
Defines a mouse command to be executed instead of the default behavior when clicking on the non-statu...
struct Barconfig::bar_colors colors
char * inactive_workspace_border
#define INIT_COLOR(x, cborder, cbackground, ctext, cindicator)
char * i3bar_command
Command that should be run to execute i3bar, give a full path if i3bar is not in your $PATH...
#define SLIST_INSERT_HEAD(head, elm, field)
void set_font(i3Font *font)
Defines the font to be used for the forthcoming calls.
char * id
Automatically generated ID for this bar config.
void load_configuration(xcb_connection_t *conn, const char *override_configpath, bool reload)
Reads the configuration from ~/.i3/config or /etc/i3/config if not found.
struct assignments_head assignments
char * sstrdup(const char *str)
Safe-wrapper around strdup which exits if malloc returns NULL (meaning that there is no more memory a...
Holds a keybinding, consisting of a keycode combined with modifiers and the command which is executed...