aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bar
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-08 22:23:35 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-08 22:23:55 +1000
commit5e1983660dddc40d60026cbd0daf96d880f24fb9 (patch)
tree1036293744616474f190d30f7ae5428579e82900 /sway/commands/bar
parentAdd example status_command to default config (diff)
downloadsway-5e1983660dddc40d60026cbd0daf96d880f24fb9.tar.gz
sway-5e1983660dddc40d60026cbd0daf96d880f24fb9.tar.zst
sway-5e1983660dddc40d60026cbd0daf96d880f24fb9.zip
Allow status_command to be disabled via IPC
Diffstat (limited to 'sway/commands/bar')
-rw-r--r--sway/commands/bar/status_command.c16
1 files changed, 13 insertions, 3 deletions
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) {
13 "status_command", "No bar defined."); 13 "status_command", "No bar defined.");
14 } 14 }
15 free(config->current_bar->status_command); 15 free(config->current_bar->status_command);
16 config->current_bar->status_command = join_args(argv, argc); 16 config->current_bar->status_command = NULL;
17 wlr_log(WLR_DEBUG, "Feeding bar with status command: %s", 17
18 config->current_bar->status_command); 18 char *new_command = join_args(argv, argc);
19 if (strcmp(new_command, "-") != 0) {
20 config->current_bar->status_command = new_command;
21 wlr_log(WLR_DEBUG, "Feeding bar with status command: %s",
22 config->current_bar->status_command);
23 }
24
25 if (config->active && !config->validating) {
26 load_swaybars();
27 }
28
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 29 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20} 30}