diff options
Diffstat (limited to 'sway/commands/default_floating_border.c')
-rw-r--r-- | sway/commands/default_floating_border.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sway/commands/default_floating_border.c b/sway/commands/default_floating_border.c new file mode 100644 index 00000000..1bfc24af --- /dev/null +++ b/sway/commands/default_floating_border.c | |||
@@ -0,0 +1,29 @@ | |||
1 | #include "log.h" | ||
2 | #include "sway/commands.h" | ||
3 | #include "sway/config.h" | ||
4 | #include "sway/tree/container.h" | ||
5 | |||
6 | struct cmd_results *cmd_default_floating_border(int argc, char **argv) { | ||
7 | struct cmd_results *error = NULL; | ||
8 | if ((error = checkarg(argc, "default_floating_border", | ||
9 | EXPECTED_AT_LEAST, 1))) { | ||
10 | return error; | ||
11 | } | ||
12 | |||
13 | if (strcmp(argv[0], "none") == 0) { | ||
14 | config->floating_border = B_NONE; | ||
15 | } else if (strcmp(argv[0], "normal") == 0) { | ||
16 | config->floating_border = B_NORMAL; | ||
17 | } else if (strcmp(argv[0], "pixel") == 0) { | ||
18 | config->floating_border = B_PIXEL; | ||
19 | } else { | ||
20 | return cmd_results_new(CMD_INVALID, "default_floating_border", | ||
21 | "Expected 'default_floating_border <none|normal|pixel>' " | ||
22 | "or 'default_floating_border <normal|pixel> <px>'"); | ||
23 | } | ||
24 | if (argc == 2) { | ||
25 | config->floating_border_thickness = atoi(argv[1]); | ||
26 | } | ||
27 | |||
28 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
29 | } | ||