aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/swaybg_command.c
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-10-08 15:18:49 -0400
committerGitHub <noreply@github.com>2018-10-08 15:18:49 -0400
commit3f328b62768d7801f0544b31ab8f9dde3014fd1d (patch)
tree3572a9e1bff58710c22638d85ce1206af3999d94 /sway/commands/swaybg_command.c
parentd21d2c8665f8fdaad719bb81cc636052f7c1d1a1 (diff)
parenta03955f9368cfa1c190e4194eed8437dce22eb77 (diff)
Merge branch 'master' into popup-during-fullscreen
Diffstat (limited to 'sway/commands/swaybg_command.c')
-rw-r--r--sway/commands/swaybg_command.c15
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);
}