From 1fd2c6ba498e61f4fe823bf552f9d2fce8612de4 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 2 Sep 2019 21:41:11 -0400 Subject: swaybar: complete barconfig_update event handling This adds complete support for the barconfig_update ipc event. This also changes the bar command and subcommand handlers to correctly emit the event. This makes it so all bar subcommands other than id and swaybar_command are dynamically changeable at runtime. sway-bar.5 has been updated accordingly --- sway/commands/bar/tray_output.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sway/commands/bar/tray_output.c') diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c index 8bfdf193..eb3b486e 100644 --- a/sway/commands/bar/tray_output.c +++ b/sway/commands/bar/tray_output.c @@ -24,9 +24,21 @@ struct cmd_results *bar_cmd_tray_output(int argc, char **argv) { free(outputs->items[i]); } outputs->length = 0; + } else if (strcmp(argv[0], "*") == 0) { + sway_log(SWAY_DEBUG, "Showing tray on all outputs for bar: %s", + config->current_bar->id); + while (outputs->length) { + free(outputs->items[0]); + list_del(outputs, 0); + } + return cmd_results_new(CMD_SUCCESS, NULL); } else { sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], config->current_bar->id); + if (outputs->length == 1 && strcmp(outputs->items[0], "none") == 0) { + free(outputs->items[0]); + list_del(outputs, 0); + } } list_add(outputs, strdup(argv[0])); -- cgit v1.2.3-54-g00ecf