diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-17 10:39:22 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-17 10:39:22 -0500 |
commit | 88bcd43ebf59cfa03a9e9a158c6f7a258c1f7db2 (patch) | |
tree | 4c2b9321ab9d5f7a9aeed35c7d6826c5da4e496f /sway/commands/seat | |
parent | e27eff8a29abd74448322ae78baa99a489e43620 (diff) |
seat fallback config
Diffstat (limited to 'sway/commands/seat')
-rw-r--r-- | sway/commands/seat/fallback.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sway/commands/seat/fallback.c b/sway/commands/seat/fallback.c new file mode 100644 index 00000000..7c129aae --- /dev/null +++ b/sway/commands/seat/fallback.c @@ -0,0 +1,29 @@ +#include <string.h> +#include <strings.h> +#include "sway/config.h" +#include "sway/commands.h" +#include "sway/input/input-manager.h" + +struct cmd_results *seat_cmd_fallback(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "fallback", EXPECTED_AT_LEAST, 1))) { + return error; + } + if (!current_seat_config) { + return cmd_results_new(CMD_FAILURE, "fallback", "No seat defined"); + } + struct seat_config *new_config = + new_seat_config(current_seat_config->name); + + if (strcasecmp(argv[0], "true") == 0) { + new_config->fallback = 1; + } else if (strcasecmp(argv[0], "false") == 0) { + new_config->fallback = 0; + } else { + return cmd_results_new(CMD_INVALID, "fallback", + "Expected 'fallback <true|false>'"); + } + + apply_seat_config(new_config); + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} |