diff options
Diffstat (limited to 'sway/commands/swaybg_command.c')
-rw-r--r-- | sway/commands/swaybg_command.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sway/commands/swaybg_command.c b/sway/commands/swaybg_command.c index 36f7fdcd..b184b193 100644 --- a/sway/commands/swaybg_command.c +++ b/sway/commands/swaybg_command.c @@ -9,12 +9,17 @@ struct cmd_results *cmd_swaybg_command(int argc, char **argv) { return error; } - if (config->swaybg_command) { - free(config->swaybg_command); + free(config->swaybg_command); + config->swaybg_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 swaybg command: %s", + config->swaybg_command); + } else { + free(new_command); } - config->swaybg_command = join_args(argv, argc); - wlr_log(WLR_DEBUG, "Using custom swaybg command: %s", - config->swaybg_command); return cmd_results_new(CMD_SUCCESS, NULL, NULL); } |