]> git.sur5r.net Git - i3/i3/blob - i3bar/include/config.h
fdc37445ab4944549742ca7c580fa4f488e51de0
[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-2011 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 config_t {
26     int modifier;
27     char *wheel_up_cmd;
28     char *wheel_down_cmd;
29     position_t position;
30     int verbose;
31     struct xcb_color_strings_t colors;
32     bool disable_binding_mode_indicator;
33     bool disable_ws;
34     bool strip_ws_numbers;
35     char *bar_id;
36     char *command;
37     char *fontname;
38     i3String *separator_symbol;
39     char *tray_output;
40     int num_outputs;
41     char **outputs;
42
43     bar_display_mode_t hide_on_modifier;
44
45     /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
46     enum { S_HIDE = 0,
47            S_SHOW = 1 } hidden_state;
48 } config_t;
49
50 config_t config;
51
52 /**
53  * Start parsing the received bar configuration JSON string
54  *
55  */
56 void parse_config_json(char *json);
57
58 /**
59  * free()s the color strings as soon as they are not needed anymore.
60  *
61  */
62 void free_colors(struct xcb_color_strings_t *colors);