From 5e1983660dddc40d60026cbd0daf96d880f24fb9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 8 Oct 2018 22:23:35 +1000 Subject: Allow status_command to be disabled via IPC --- sway/commands/bar/status_command.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sway/commands/bar') diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c index 6f6f81a3..5ea22525 100644 --- a/sway/commands/bar/status_command.c +++ b/sway/commands/bar/status_command.c @@ -13,8 +13,18 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) { "status_command", "No bar defined."); } free(config->current_bar->status_command); - config->current_bar->status_command = join_args(argv, argc); - wlr_log(WLR_DEBUG, "Feeding bar with status command: %s", - config->current_bar->status_command); + config->current_bar->status_command = NULL; + + char *new_command = join_args(argv, argc); + if (strcmp(new_command, "-") != 0) { + config->current_bar->status_command = new_command; + wlr_log(WLR_DEBUG, "Feeding bar with status command: %s", + config->current_bar->status_command); + } + + if (config->active && !config->validating) { + load_swaybars(); + } + return cmd_results_new(CMD_SUCCESS, NULL, NULL); } -- cgit v1.2.3