diff options
author | emersion <contact@emersion.fr> | 2018-05-01 15:31:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 15:31:02 +0100 |
commit | 0e51c7be449dd68025d5acd8c634f8dcacb10a16 (patch) | |
tree | c2c7e713a150c7f9a947b100e0fa4c56efb5c3b2 /sway/commands/default_border.c | |
parent | bf0603cd2d905554cc57d121b56b6708bb1d382b (diff) | |
parent | cb07434913b89580a4025824cb181733b2db1eb7 (diff) |
Merge pull request #1874 from RyanDwyer/borders
Implement borders
Diffstat (limited to 'sway/commands/default_border.c')
-rw-r--r-- | sway/commands/default_border.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sway/commands/default_border.c b/sway/commands/default_border.c new file mode 100644 index 00000000..fcd2c075 --- /dev/null +++ b/sway/commands/default_border.c @@ -0,0 +1,27 @@ +#include "log.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/tree/container.h" + +struct cmd_results *cmd_default_border(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "default_border", EXPECTED_AT_LEAST, 1))) { + return error; + } + + if (strcmp(argv[0], "none") == 0) { + config->border = B_NONE; + } else if (strcmp(argv[0], "normal") == 0) { + config->border = B_NORMAL; + } else if (strcmp(argv[0], "pixel") == 0) { + config->border = B_PIXEL; + if (argc == 2) { + config->border_thickness = atoi(argv[1]); + } + } else { + return cmd_results_new(CMD_INVALID, "default_border", + "Expected 'default_border <none|normal|pixel>' or 'default_border pixel <px>'"); + } + + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} |