diff options
Diffstat (limited to 'sway/old/commands/orientation.c')
-rw-r--r-- | sway/old/commands/orientation.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sway/old/commands/orientation.c b/sway/old/commands/orientation.c new file mode 100644 index 00000000..e54b60ee --- /dev/null +++ b/sway/old/commands/orientation.c | |||
@@ -0,0 +1,21 @@ | |||
1 | #include <string.h> | ||
2 | #include <strings.h> | ||
3 | #include "sway/commands.h" | ||
4 | |||
5 | struct cmd_results *cmd_orientation(int argc, char **argv) { | ||
6 | struct cmd_results *error = NULL; | ||
7 | if (!config->reading) return cmd_results_new(CMD_FAILURE, "orientation", "Can only be used in config file."); | ||
8 | if ((error = checkarg(argc, "orientation", EXPECTED_EQUAL_TO, 1))) { | ||
9 | return error; | ||
10 | } | ||
11 | if (strcasecmp(argv[0], "horizontal") == 0) { | ||
12 | config->default_orientation = L_HORIZ; | ||
13 | } else if (strcasecmp(argv[0], "vertical") == 0) { | ||
14 | config->default_orientation = L_VERT; | ||
15 | } else if (strcasecmp(argv[0], "auto") == 0) { | ||
16 | // Do nothing | ||
17 | } else { | ||
18 | return cmd_results_new(CMD_INVALID, "orientation", "Expected 'orientation <horizontal|vertical|auto>'"); | ||
19 | } | ||
20 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
21 | } | ||