diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-09-02 21:41:11 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-04 16:48:50 -1000 |
commit | 1fd2c6ba498e61f4fe823bf552f9d2fce8612de4 (patch) | |
tree | 8e2d9adab3451f1f05c76340d466a442c840e558 /sway/commands/bar/tray_output.c | |
parent | seatop_default: only focus container on press (diff) | |
download | sway-1fd2c6ba498e61f4fe823bf552f9d2fce8612de4.tar.gz sway-1fd2c6ba498e61f4fe823bf552f9d2fce8612de4.tar.zst sway-1fd2c6ba498e61f4fe823bf552f9d2fce8612de4.zip |
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
Diffstat (limited to 'sway/commands/bar/tray_output.c')
-rw-r--r-- | sway/commands/bar/tray_output.c | 12 |
1 files changed, 12 insertions, 0 deletions
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) { | |||
24 | free(outputs->items[i]); | 24 | free(outputs->items[i]); |
25 | } | 25 | } |
26 | outputs->length = 0; | 26 | outputs->length = 0; |
27 | } else if (strcmp(argv[0], "*") == 0) { | ||
28 | sway_log(SWAY_DEBUG, "Showing tray on all outputs for bar: %s", | ||
29 | config->current_bar->id); | ||
30 | while (outputs->length) { | ||
31 | free(outputs->items[0]); | ||
32 | list_del(outputs, 0); | ||
33 | } | ||
34 | return cmd_results_new(CMD_SUCCESS, NULL); | ||
27 | } else { | 35 | } else { |
28 | sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], | 36 | sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], |
29 | config->current_bar->id); | 37 | config->current_bar->id); |
38 | if (outputs->length == 1 && strcmp(outputs->items[0], "none") == 0) { | ||
39 | free(outputs->items[0]); | ||
40 | list_del(outputs, 0); | ||
41 | } | ||
30 | } | 42 | } |
31 | list_add(outputs, strdup(argv[0])); | 43 | list_add(outputs, strdup(argv[0])); |
32 | 44 | ||