diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-10-10 10:49:34 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-10-13 17:55:49 -0400 |
commit | 84b28dc5937e156db27df50854f93a7cfad82387 (patch) | |
tree | 95d477ee8b409550071e5b8de323ed72f02b4a01 /sway/commands/bar | |
parent | bar_cmd_status_command: only reload current bar (diff) | |
download | sway-84b28dc5937e156db27df50854f93a7cfad82387.tar.gz sway-84b28dc5937e156db27df50854f93a7cfad82387.tar.zst sway-84b28dc5937e156db27df50854f93a7cfad82387.zip |
cmd_bar: fix bar id issues
Allows bar-subcommand to be a valid bar-ids
Destroys runtime created bar if trying to use a config only subcommand
Allow subcommands (except for id) to be ids
Diffstat (limited to 'sway/commands/bar')
-rw-r--r-- | sway/commands/bar/id.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c index 65fa69fd..7690a852 100644 --- a/sway/commands/bar/id.c +++ b/sway/commands/bar/id.c | |||
@@ -13,6 +13,8 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) { | |||
13 | const char *oldname = config->current_bar->id; | 13 | const char *oldname = config->current_bar->id; |
14 | if (strcmp(name, oldname) == 0) { | 14 | if (strcmp(name, oldname) == 0) { |
15 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); // NOP | 15 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); // NOP |
16 | } else if (strcmp(name, "id") == 0) { | ||
17 | return cmd_results_new(CMD_INVALID, "id", "id cannot be 'id'"); | ||
16 | } | 18 | } |
17 | // check if id is used by a previously defined bar | 19 | // check if id is used by a previously defined bar |
18 | for (int i = 0; i < config->bars->length; ++i) { | 20 | for (int i = 0; i < config->bars->length; ++i) { |