From 09c3c33081a8b8c941cbc1eeab0e5a70e54d04ff Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 8 Oct 2018 09:56:34 -0400 Subject: Allow swaynag to be disabled --- sway/commands/swaynag_command.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sway/commands') diff --git a/sway/commands/swaynag_command.c b/sway/commands/swaynag_command.c index c57a80a6..6c86f1a7 100644 --- a/sway/commands/swaynag_command.c +++ b/sway/commands/swaynag_command.c @@ -9,12 +9,17 @@ struct cmd_results *cmd_swaynag_command(int argc, char **argv) { return error; } - if (config->swaynag_command) { - free(config->swaynag_command); + free(config->swaynag_command); + config->swaynag_command = NULL; + + char *new_command = join_args(argv, argc); + if (strcmp(new_command, "-") != 0) { + config->swaybg_command = new_command; + wlr_log(WLR_DEBUG, "Using custom swaynag command: %s", + config->swaynag_command); + } else { + free(new_command); } - config->swaynag_command = join_args(argv, argc); - wlr_log(WLR_DEBUG, "Using custom swaynag command: %s", - config->swaynag_command); return cmd_results_new(CMD_SUCCESS, NULL, NULL); } -- cgit v1.2.3