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/config_parse.c) with the correct path, switching key
10
* bindings mode).
11
*
12
*/
13
#ifndef I3_CONFIG_H
14
#define I3_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
layout_t
default_layout
;
99
int
container_stack_limit
;
100
int
container_stack_limit_value
;
101
int
default_border_width
;
102
104
int
default_orientation
;
105
110
bool
disable_focus_follows_mouse
;
111
116
adjacent_t
hide_edge_borders
;
117
122
bool
disable_workspace_bar
;
123
132
bool
force_focus_wrapping
;
133
142
bool
force_xinerama
;
143
145
char
*
fake_outputs
;
146
151
bool
workspace_auto_back_and_forth
;
152
158
float
workspace_urgency_timer
;
159
161
border_style_t
default_border
;
162
164
border_style_t
default_floating_border
;
165
168
uint32_t
floating_modifier
;
169
171
int32_t
floating_maximum_width
;
172
int32_t
floating_maximum_height
;
173
int32_t
floating_minimum_width
;
174
int32_t
floating_minimum_height
;
175
176
/* Color codes are stored here */
177
struct
config_client
{
178
uint32_t
background
;
179
struct
Colortriple
focused
;
180
struct
Colortriple
focused_inactive;
181
struct
Colortriple
unfocused;
182
struct
Colortriple
urgent;
183
} client;
184
struct
config_bar
{
185
struct
Colortriple
focused
;
186
struct
Colortriple
unfocused;
187
struct
Colortriple
urgent;
188
} bar;
189
191
enum
{
192
/* display (and focus) the popup when it belongs to the fullscreen
193
* window only. */
194
PDF_SMART = 0,
195
196
/* leave fullscreen mode unconditionally */
197
PDF_LEAVE_FULLSCREEN = 1,
198
199
/* just ignore the popup, that is, don’t map it */
200
PDF_IGNORE = 2,
201
} popup_during_fullscreen;
202
203
/* The number of currently parsed barconfigs */
204
int
number_barconfigs
;
205
};
206
212
struct
Barconfig
{
215
char
*
id
;
216
218
int
num_outputs
;
221
char
**
outputs
;
222
225
char
*
tray_output
;
226
230
char
*
socket_path
;
231
233
enum
{ M_DOCK = 0, M_HIDE = 1, M_INVISIBLE = 2 } mode;
234
235
/* The current hidden_state of the bar, which indicates whether it is hidden or shown */
236
enum
{ S_HIDE = 0, S_SHOW = 1 } hidden_state;
237
239
enum
{
240
M_NONE = 0,
241
M_CONTROL = 1,
242
M_SHIFT = 2,
243
M_MOD1 = 3,
244
M_MOD2 = 4,
245
M_MOD3 = 5,
246
M_MOD4 = 6,
247
M_MOD5 = 7
248
} modifier;
249
251
enum
{ P_BOTTOM = 0, P_TOP = 1 } position;
252
256
char
*
i3bar_command
;
257
260
char
*
status_command
;
261
263
char
*
font
;
264
268
bool
hide_workspace_buttons
;
269
271
bool
verbose
;
272
273
struct
bar_colors
{
274
char
*
background
;
275
char
*
statusline
;
276
char
*
separator
;
277
278
char
*
focused_workspace_border
;
279
char
*
focused_workspace_bg
;
280
char
*
focused_workspace_text
;
281
282
char
*
active_workspace_border
;
283
char
*
active_workspace_bg
;
284
char
*
active_workspace_text
;
285
286
char
*
inactive_workspace_border
;
287
char
*
inactive_workspace_bg
;
288
char
*
inactive_workspace_text
;
289
290
char
*
urgent_workspace_border
;
291
char
*
urgent_workspace_bg
;
292
char
*
urgent_workspace_text
;
293
}
colors
;
294
295
TAILQ_ENTRY
(
Barconfig
) configs;
296
};
297
305
void
load_configuration
(xcb_connection_t *
conn
, const
char
*override_configfile,
bool
reload);
306
311
void
translate_keysyms
(
void
);
312
318
void
ungrab_all_keys
(xcb_connection_t *conn);
319
324
void
grab_all_keys
(xcb_connection_t *conn,
bool
bind_mode_switch);
325
330
void
switch_mode
(const
char
*new_mode);
331
void
update_barconfig
();
337
343
Binding
*
get_binding
(uint16_t modifiers,
bool
key_release, xcb_keycode_t keycode);
344
354
void
kill_configerror_nagbar
(
bool
wait_for_it);
355
356
#endif
Generated by
1.8.4