i3
|
Go to the source code of this file.
Macros | |
#define | GRAB_KEY(modifier) |
#define | REQUIRED_OPTION(name) |
#define | INIT_COLOR(x, cborder, cbackground, ctext, cindicator) |
Functions | |
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 configuration file reload. More... | |
static void | grab_keycode_for_binding (xcb_connection_t *conn, Binding *bind, uint32_t keycode) |
Binding * | get_binding (uint16_t modifiers, xcb_keycode_t keycode) |
Returns a pointer to the Binding with the specified modifiers and keycode or NULL if no such binding exists. More... | |
void | translate_keysyms (void) |
Translates keysymbols to keycodes for all bindings which use keysyms. More... | |
void | grab_all_keys (xcb_connection_t *conn, bool bind_mode_switch) |
Grab the bound keys (tell X to send us keypress events for those keycodes) More... | |
void | switch_mode (const char *new_mode) |
Switches the key bindings to the given mode, if the mode exists. More... | |
static char * | get_config_path (const char *override_configpath) |
static void | parse_configuration (const char *override_configpath) |
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. More... | |
Variables | |
char * | current_configpath = NULL |
Config | config |
struct modes_head | modes |
struct barconfig_head | barconfigs = TAILQ_HEAD_INITIALIZER(barconfigs) |
#define GRAB_KEY | ( | modifier | ) |
Referenced by grab_keycode_for_binding().
#define INIT_COLOR | ( | x, | |
cborder, | |||
cbackground, | |||
ctext, | |||
cindicator | |||
) |
Referenced by load_configuration().
#define REQUIRED_OPTION | ( | name | ) |
Binding* get_binding | ( | uint16_t | modifiers, |
xcb_keycode_t | keycode | ||
) |
Returns a pointer to the Binding with the specified modifiers and keycode or NULL if no such binding exists.
Definition at line 55 of file config.c.
References bindings, Binding::keycode, Binding::mods, Binding::number_keycodes, Binding::symbol, TAILQ_END, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_key_press().
|
static |
Definition at line 183 of file config.c.
References die, path_exists(), resolve_tilde(), sasprintf(), and sstrdup().
Referenced by parse_configuration().
void grab_all_keys | ( | xcb_connection_t * | conn, |
bool | bind_mode_switch | ||
) |
Grab the bound keys (tell X to send us keypress events for those keycodes)
Definition at line 133 of file config.c.
References BIND_MODE_SWITCH, bindings, grab_keycode_for_binding(), Binding::keycode, Binding::mods, Binding::number_keycodes, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_mapping_notify(), load_configuration(), main(), switch_mode(), and xkb_got_event().
|
static |
Definition at line 31 of file config.c.
References BIND_MODE_SWITCH, DLOG, GRAB_KEY, Binding::mods, and xcb_numlock_mask.
Referenced by grab_all_keys().
void load_configuration | ( | xcb_connection_t * | conn, |
const char * | override_configfile, | ||
bool | reload | ||
) |
Reads the configuration from ~/.i3/config or /etc/i3/config if not found.
If you specify override_configpath, only this path is used to look for a configuration file.
Definition at line 261 of file config.c.
References Assignment::A_COMMAND, Assignment::A_TO_OUTPUT, Assignment::A_TO_WORKSPACE, Barconfig::bar_colors::active_workspace_bg, Barconfig::bar_colors::active_workspace_border, Barconfig::bar_colors::active_workspace_text, all_cons, assignments, Config::config_client::background, Barconfig::bar_colors::background, Config::bar, barconfigs, bindings, Mode::bindings, BS_NORMAL, Config::client, Barconfig::colors, Binding::command, Assignment::command, croot, Con::deco_render_params, Config::default_border, Config::default_floating_border, Config::default_orientation, Assignment::dest, ELOG, Config::config_client::focused, Config::config_bar::focused, Config::config_client::focused_inactive, Barconfig::bar_colors::focused_workspace_bg, Barconfig::bar_colors::focused_workspace_border, Barconfig::bar_colors::focused_workspace_text, Config::font, Barconfig::font, FREE, free_font(), get_colorpixel(), grab_all_keys(), Barconfig::i3bar_command, Font::id, Barconfig::id, Barconfig::bar_colors::inactive_workspace_bg, Barconfig::bar_colors::inactive_workspace_border, Barconfig::bar_colors::inactive_workspace_text, INIT_COLOR, load_font(), Assignment::match, match_free(), modes, Mode::name, NO_ORIENTATION, Barconfig::num_outputs, Assignment::output, Barconfig::outputs, parse_configuration(), predict_text_width(), scalloc(), set_font(), SLIST_EMPTY, SLIST_FIRST, SLIST_INIT, SLIST_INSERT_HEAD, SLIST_REMOVE, Barconfig::socket_path, sstrdup(), Barconfig::status_command, Barconfig::bar_colors::statusline, TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_INIT, TAILQ_REMOVE, translate_keysyms(), Binding::translated_to, Barconfig::tray_output, Assignment::type, Config::config_client::unfocused, Config::config_bar::unfocused, ungrab_all_keys(), Config::config_client::urgent, Config::config_bar::urgent, Barconfig::bar_colors::urgent_workspace_bg, Barconfig::bar_colors::urgent_workspace_border, Barconfig::bar_colors::urgent_workspace_text, Assignment::workspace, and x_deco_recurse().
Referenced by cmd_reload(), and main().
|
static |
Definition at line 249 of file config.c.
References current_configpath, FREE, get_config_path(), LOG, and parse_file().
Referenced by load_configuration().
void switch_mode | ( | const char * | new_mode | ) |
Switches the key bindings to the given mode, if the mode exists.
Definition at line 156 of file config.c.
References bindings, Mode::bindings, conn, ELOG, grab_all_keys(), LOG, modes, Mode::name, SLIST_FOREACH, translate_keysyms(), and ungrab_all_keys().
Referenced by cmd_mode().
void translate_keysyms | ( | void | ) |
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition at line 84 of file config.c.
References BIND_MODE_SWITCH, bindings, conn, DLOG, ELOG, FREE, Binding::keycode, keysyms, Binding::mods, Binding::number_keycodes, srealloc(), Binding::symbol, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_mapping_notify(), load_configuration(), main(), switch_mode(), and xkb_got_event().
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 configuration file reload.
Definition at line 26 of file config.c.
Referenced by handle_mapping_notify(), load_configuration(), switch_mode(), and xkb_got_event().
struct barconfig_head barconfigs = TAILQ_HEAD_INITIALIZER(barconfigs) |
Definition at line 19 of file config.c.
Referenced by IPC_HANDLER(), load_configuration(), main(), migrate_i3bar_exec(), and yyparse().
Config config |
Definition at line 17 of file config.c.
Referenced by _tree_next(), check_crossing_screen_boundary(), cmd_workspace_name(), con_attach(), con_new(), con_set_border_style(), con_set_layout(), create_workspace_on_output(), floating_enable(), handle_button_press(), handle_configure_request(), handle_enter_notify(), handle_motion_notify(), handle_signal(), IPC_HANDLER(), main(), manage_window(), output_change_mode(), render_con(), resize_graphical_handler(), store_restart_layout(), workspace_attach_to(), workspace_get(), x_draw_decoration(), and yyparse().
char* current_configpath = NULL |
Definition at line 16 of file config.c.
Referenced by parse_configuration(), and x_set_i3_atoms().
struct modes_head modes |
Definition at line 18 of file config.c.
Referenced by load_configuration(), switch_mode(), and yyparse().