aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-10-08 16:24:46 +0200
committerGitHub <noreply@github.com>2018-10-08 16:24:46 +0200
commit16e727a6541d3e44c60b116c4278b6bb9f51e3c6 (patch)
tree9f657329f7775cd764b60326a419d369eae8a605 /sway/commands
parent45f2cd0c73cb21bea6ae27bd396cd3721f3cd41a (diff)
parent09c3c33081a8b8c941cbc1eeab0e5a70e54d04ff (diff)
Merge pull request #2795 from RedSoxFan/swaynag-disable
Allow swaynag to be disabled
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/swaynag_command.c15
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);
}