i3
Main Page
Data Structures
Files
File List
Globals
include
config.h
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-2012 Michael Stapelberg and contributors (see also: LICENSE)
6
*
7
* include/config.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/cfgparse.y) with the correct path, switching key bindings
10
* mode).
11
*
12
*/
13
#ifndef _CONFIG_H
14
#define _CONFIG_H
15
16
#include <stdbool.h>
17
#include "
queue.h
"
18
#include "
i3.h
"
19
#include "
libi3.h
"
20
21
typedef
struct
Config
Config
;
22
typedef
struct
Barconfig
Barconfig
;
23
extern
char
*
current_configpath
;
24
extern
Config
config
;
25
extern
SLIST_HEAD
(modes_head,
Mode
)
modes
;
26
extern
TAILQ_HEAD
(barconfig_head,
Barconfig
)
barconfigs
;
27
33
struct
context
{
34
bool
has_errors
;
35
bool
has_warnings
;
36
37
int
line_number
;
38
char
*
line_copy
;
39
const
char
*
filename
;
40
41
char
*
compact_error
;
42
43
/* These are the same as in YYLTYPE */
44
int
first_column
;
45
int
last_column
;
46
};
47
53
struct
Colortriple
{
54
uint32_t
border
;
55
uint32_t
background
;
56
uint32_t
text
;
57
uint32_t
indicator
;
58
};
59
65
struct
Variable
{
66
char
*
key
;
67
char
*
value
;
68
char
*
next_match
;
69
70
SLIST_ENTRY
(
Variable
) variables;
71
};
72
79
struct
Mode
{
80
char
*
name
;
81
struct
bindings_head *
bindings
;
82
83
SLIST_ENTRY
(Mode)
modes
;
84
};
85
91
struct
Config
{
92
const
char
*
terminal
;
93
i3Font
font
;
94
95
char
*
ipc_socket_path
;
96
const
char
*
restart_state_path
;
97
98
int
default_layout
;
99
int
container_stack_limit
;
100
int
container_stack_limit_value
;
101
103
int
default_orientation
;
104
109
bool
disable_focus_follows_mouse
;
110
115
adjacent_t
hide_edge_borders
;
116
121
bool
disable_workspace_bar
;
122
131
bool
force_focus_wrapping
;
132
141
bool
force_xinerama
;
142
144
char
*
fake_outputs
;
145
150
bool
workspace_auto_back_and_forth
;
151
153
border_style_t
default_border
;
154
156
border_style_t
default_floating_border
;
157
160
uint32_t
floating_modifier
;
161
163
int32_t
floating_maximum_width
;
164
int32_t
floating_maximum_height
;
165
int32_t
floating_minimum_width
;
166
int32_t
floating_minimum_height
;
167
168
/* Color codes are stored here */
169
struct
config_client
{
170
uint32_t
background
;
171
struct
Colortriple
focused
;
172
struct
Colortriple
focused_inactive;
173
struct
Colortriple
unfocused;
174
struct
Colortriple
urgent;
175
} client;
176
struct
config_bar
{
177
struct
Colortriple
focused
;
178
struct
Colortriple
unfocused;
179
struct
Colortriple
urgent;
180
} bar;
181
183
enum
{
184
PDF_LEAVE_FULLSCREEN = 0,
185
PDF_IGNORE = 1
186
} popup_during_fullscreen;
187
};
188
194
struct
Barconfig
{
197
char
*
id
;
198
200
int
num_outputs
;
203
char
**
outputs
;
204
207
char
*
tray_output
;
208
212
char
*
socket_path
;
213
215
enum
{ M_DOCK = 0, M_HIDE = 1 } mode;
216
218
enum
{
219
M_NONE = 0,
220
M_CONTROL = 1,
221
M_SHIFT = 2,
222
M_MOD1 = 3,
223
M_MOD2 = 4,
224
M_MOD3 = 5,
225
M_MOD4 = 6,
226
M_MOD5 = 7
227
} modifier;
228
230
enum
{ P_BOTTOM = 0, P_TOP = 1 } position;
231
235
char
*
i3bar_command
;
236
239
char
*
status_command
;
240
242
char
*
font
;
243
247
bool
hide_workspace_buttons
;
248
250
bool
verbose
;
251
252
struct
bar_colors
{
253
char
*
background
;
254
char
*
statusline
;
255
256
char
*
focused_workspace_border
;
257
char
*
focused_workspace_bg
;
258
char
*
focused_workspace_text
;
259
260
char
*
active_workspace_border
;
261
char
*
active_workspace_bg
;
262
char
*
active_workspace_text
;
263
264
char
*
inactive_workspace_border
;
265
char
*
inactive_workspace_bg
;
266
char
*
inactive_workspace_text
;
267
268
char
*
urgent_workspace_border
;
269
char
*
urgent_workspace_bg
;
270
char
*
urgent_workspace_text
;
271
}
colors
;
272
273
TAILQ_ENTRY
(
Barconfig
) configs;
274
};
275
283
void
load_configuration
(xcb_connection_t *
conn
, const
char
*override_configfile,
bool
reload);
284
289
void
translate_keysyms
(
void
);
290
296
void
ungrab_all_keys
(xcb_connection_t *conn);
297
302
void
grab_all_keys
(xcb_connection_t *conn,
bool
bind_mode_switch);
303
308
void
switch_mode
(const
char
*new_mode);
309
315
Binding
*
get_binding
(uint16_t modifiers,
bool
key_release, xcb_keycode_t keycode);
316
326
void
kill_configerror_nagbar
(
bool
wait_for_it);
327
328
/* prototype for src/cfgparse.y */
329
void
parse_file
(const
char
*f);
330
331
#endif
Generated by
1.8.1.2