i3/i3bar/include/config.h
Ingo Bürk bc250b26a0 Allow multiple tray_output directives.
This patch introduces the possibility to specify the tray_output directive
multiple times. All values will be used by i3bar, in the order they are
given.

This way, a single bar configuration can be used for several machines with
internal output names "eDP1" and "LVDS-0" by specifying tray_output for both.
Any external output (e.g., "DP-0") will still not receive the tray. The same
effect can be achieved by using "primary", but forces the user to couple the
tray display to the primary output which may not be desirable behavior.

relates to #555
2015-11-01 16:35:17 -05:00

76 lines
1.7 KiB
C

/*
* vim:ts=4:sw=4:expandtab
*
* i3bar - an xcb-based status- and ws-bar for i3
* © 2010 Axel Wagner and contributors (see also: LICENSE)
*
* config.c: Parses the configuration (received from i3).
*
*/
#pragma once
#include "common.h"
typedef enum {
POS_NONE = 0,
POS_TOP,
POS_BOT
} position_t;
/* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */
typedef enum { M_DOCK = 0,
M_HIDE = 1,
M_INVISIBLE = 2 } bar_display_mode_t;
typedef struct binding_t {
int input_code;
char *command;
TAILQ_ENTRY(binding_t) bindings;
} binding_t;
typedef struct tray_output_t {
char *output;
TAILQ_ENTRY(tray_output_t) tray_outputs;
} tray_output_t;
typedef struct config_t {
int modifier;
TAILQ_HEAD(bindings_head, binding_t) bindings;
position_t position;
int verbose;
struct xcb_color_strings_t colors;
bool disable_binding_mode_indicator;
bool disable_ws;
bool strip_ws_numbers;
char *bar_id;
char *command;
char *fontname;
i3String *separator_symbol;
TAILQ_HEAD(tray_outputs_head, tray_output_t) tray_outputs;
int tray_padding;
int num_outputs;
char **outputs;
bar_display_mode_t hide_on_modifier;
/* The current hidden_state of the bar, which indicates whether it is hidden or shown */
enum { S_HIDE = 0,
S_SHOW = 1 } hidden_state;
} config_t;
config_t config;
/**
* Start parsing the received bar configuration JSON string
*
*/
void parse_config_json(char *json);
/**
* free()s the color strings as soon as they are not needed anymore.
*
*/
void free_colors(struct xcb_color_strings_t *colors);