summaryrefslogtreecommitdiffstats
path: root/sway/old/commands/orientation.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-11-18 11:22:02 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-11-18 11:22:02 -0500
commit733993a651c71f7e2198d505960d6bbd31e0e107 (patch)
treee51732c5872b624e73355f9e5b3f762101f3cd0d /sway/old/commands/orientation.c
parentInitial (awful) pass on xdg shell support (diff)
downloadsway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.gz
sway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.zst
sway-733993a651c71f7e2198d505960d6bbd31e0e107.zip
Move everything to sway/old/
Diffstat (limited to 'sway/old/commands/orientation.c')
-rw-r--r--sway/old/commands/orientation.c21
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
5struct 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}