diff options
Diffstat (limited to 'sway/commands/focus_on_window_activation.c')
-rw-r--r-- | sway/commands/focus_on_window_activation.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/commands/focus_on_window_activation.c b/sway/commands/focus_on_window_activation.c new file mode 100644 index 00000000..1fb07918 --- /dev/null +++ b/sway/commands/focus_on_window_activation.c | |||
@@ -0,0 +1,25 @@ | |||
1 | #include "sway/commands.h" | ||
2 | |||
3 | struct cmd_results *cmd_focus_on_window_activation(int argc, char **argv) { | ||
4 | struct cmd_results *error = NULL; | ||
5 | if ((error = checkarg(argc, "focus_on_window_activation", | ||
6 | EXPECTED_EQUAL_TO, 1))) { | ||
7 | return error; | ||
8 | } | ||
9 | |||
10 | if (strcmp(argv[0], "smart") == 0) { | ||
11 | config->focus_on_window_activation = FOWA_SMART; | ||
12 | } else if (strcmp(argv[0], "urgent") == 0) { | ||
13 | config->focus_on_window_activation = FOWA_URGENT; | ||
14 | } else if (strcmp(argv[0], "focus") == 0) { | ||
15 | config->focus_on_window_activation = FOWA_FOCUS; | ||
16 | } else if (strcmp(argv[0], "none") == 0) { | ||
17 | config->focus_on_window_activation = FOWA_NONE; | ||
18 | } else { | ||
19 | return cmd_results_new(CMD_INVALID, "focus_on_window_activation", | ||
20 | "Expected " | ||
21 | "'focus_on_window_activation smart|urgent|focus|none'"); | ||
22 | } | ||
23 | |||
24 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
25 | } | ||