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
This commit is contained in:
docs
i3bar
include
src
testcases/t
14
src/ipc.c
14
src/ipc.c
@ -551,6 +551,18 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
|
||||
y(array_close);
|
||||
}
|
||||
|
||||
if (!TAILQ_EMPTY(&(config->tray_outputs))) {
|
||||
ystr("tray_outputs");
|
||||
y(array_open);
|
||||
|
||||
struct tray_output_t *tray_output;
|
||||
TAILQ_FOREACH(tray_output, &(config->tray_outputs), tray_outputs) {
|
||||
ystr(tray_output->output);
|
||||
}
|
||||
|
||||
y(array_close);
|
||||
}
|
||||
|
||||
#define YSTR_IF_SET(name) \
|
||||
do { \
|
||||
if (config->name) { \
|
||||
@ -559,8 +571,6 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
YSTR_IF_SET(tray_output);
|
||||
|
||||
ystr("tray_padding");
|
||||
y(integer, config->tray_padding);
|
||||
|
||||
|
Reference in New Issue
Block a user