]> git.sur5r.net Git - i3/i3/blob - i3bar/include/config.h
Configurable tray padding.
[i3/i3] / i3bar / include / config.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3bar - an xcb-based status- and ws-bar for i3
5  * © 2010 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * config.c: Parses the configuration (received from i3).
8  *
9  */
10 #pragma once
11
12 #include "common.h"
13
14 typedef enum {
15     POS_NONE = 0,
16     POS_TOP,
17     POS_BOT
18 } position_t;
19
20 /* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */
21 typedef enum { M_DOCK = 0,
22                M_HIDE = 1,
23                M_INVISIBLE = 2 } bar_display_mode_t;
24
25 typedef struct binding_t {
26     int input_code;
27     char *command;
28
29     TAILQ_ENTRY(binding_t) bindings;
30 } binding_t;
31
32 typedef struct config_t {
33     int modifier;
34     TAILQ_HEAD(bindings_head, binding_t) bindings;
35     position_t position;
36     int verbose;
37     struct xcb_color_strings_t colors;
38     bool disable_binding_mode_indicator;
39     bool disable_ws;
40     bool strip_ws_numbers;
41     char *bar_id;
42     char *command;
43     char *fontname;
44     i3String *separator_symbol;
45     char *tray_output;
46     int tray_padding;
47     int num_outputs;
48     char **outputs;
49
50     bar_display_mode_t hide_on_modifier;
51
52     /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
53     enum { S_HIDE = 0,
54            S_SHOW = 1 } hidden_state;
55 } config_t;
56
57 config_t config;
58
59 /**
60  * Start parsing the received bar configuration JSON string
61  *
62  */
63 void parse_config_json(char *json);
64
65 /**
66  * free()s the color strings as soon as they are not needed anymore.
67  *
68  */
69 void free_colors(struct xcb_color_strings_t *colors);