diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-10-08 15:18:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 15:18:49 -0400 |
commit | 3f328b62768d7801f0544b31ab8f9dde3014fd1d (patch) | |
tree | 3572a9e1bff58710c22638d85ce1206af3999d94 /sway/commands/swaynag_command.c | |
parent | d21d2c8665f8fdaad719bb81cc636052f7c1d1a1 (diff) | |
parent | a03955f9368cfa1c190e4194eed8437dce22eb77 (diff) | |
download | sway-3f328b62768d7801f0544b31ab8f9dde3014fd1d.tar.xz |
Merge branch 'master' into popup-during-fullscreen
Diffstat (limited to 'sway/commands/swaynag_command.c')
-rw-r--r-- | sway/commands/swaynag_command.c | 15 |
1 files changed, 10 insertions, 5 deletions
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); } |