]> git.sur5r.net Git - i3/i3/blob - include/config.h
Implement support for using key symbols in configuration file
[i3/i3] / include / config.h
1 /*
2  * vim:ts=8:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  *
6  * © 2009 Michael Stapelberg and contributors
7  *
8  * See file LICENSE for license information.
9  *
10  * include/config.h: Contains all structs/variables for
11  * the configurable part of i3
12  *
13  */
14
15 #ifndef _CONFIG_H
16 #define _CONFIG_H
17
18 #include <stdbool.h>
19 #include "queue.h"
20
21 typedef struct Config Config;
22 extern Config config;
23
24 /**
25  * Part of the struct Config. It makes sense to group colors for background,
26  * border and text as every element in i3 has them (window decorations, bar).
27  *
28  */
29 struct Colortriple {
30         uint32_t border;
31         uint32_t background;
32         uint32_t text;
33 };
34
35 /**
36  * Holds a user-assigned variable for parsing the configuration file. The key
37  * is replaced by value in every following line of the file.
38  *
39  */
40 struct Variable {
41         char *key;
42         char *value;
43
44         SLIST_ENTRY(Variable) variables;
45 };
46
47 /**
48  * Holds part of the configuration (the part which is not already in dedicated
49  * structures in include/data.h).
50  *
51  */
52 struct Config {
53         const char *terminal;
54         const char *font;
55
56         const char *ipc_socket_path;
57
58         /** The modifier which needs to be pressed in combination with your mouse
59          * buttons to do things with floating windows (move, resize) */
60         uint32_t floating_modifier;
61
62         /* Color codes are stored here */
63         struct config_client {
64                 struct Colortriple focused;
65                 struct Colortriple focused_inactive;
66                 struct Colortriple unfocused;
67         } client;
68         struct config_bar {
69                 struct Colortriple focused;
70                 struct Colortriple unfocused;
71         } bar;
72 };
73
74 /**
75  * Reads the configuration from ~/.i3/config or /etc/i3/config if not found.
76  *
77  * If you specify override_configpath, only this path is used to look for a
78  * configuration file.
79  *
80  */
81 void load_configuration(xcb_connection_t *conn, const char *override_configfile, bool reload);
82
83 /**
84  * Ungrabs all keys, to be called before re-grabbing the keys because of a
85  * mapping_notify event or a configuration file reload
86  *
87  */
88 void ungrab_all_keys(xcb_connection_t *conn);
89
90 /**
91  * Grab the bound keys (tell X to send us keypress events for those keycodes)
92  *
93  */
94 void grab_all_keys(xcb_connection_t *conn);
95
96 #endif