diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2023-10-09 22:05:05 +0100 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-03-01 21:44:52 +0100 |
commit | 44a2cff3b309f181848b535857b80e2e4e7891e1 (patch) | |
tree | 4bf19210814e8b6957f620a6f8a78c2df163082a /sway/commands/action.c | |
parent | 5e18ed3cf03eee9e83909fede46dd98dff652647 (diff) |
ext-action-binder-v1: implement new protocol
and add a new command to trigger actions.
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'sway/commands/action.c')
-rw-r--r-- | sway/commands/action.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/commands/action.c b/sway/commands/action.c new file mode 100644 index 00000000..96cb3b59 --- /dev/null +++ b/sway/commands/action.c @@ -0,0 +1,18 @@ +#include "log.h" +#include <wlr/types/wlr_action_binder_v1.h> +#include "ext-action-binder-v1-protocol.h" +#include "sway/commands.h" +#include "sway/server.h" +#include "sway/input/input-manager.h" + +struct cmd_results *cmd_action(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "action", EXPECTED_EQUAL_TO, 2))) { + return error; + } + + wlr_action_binder_v1_trigger(server.action_binder, argv[0], argv[1], + EXT_ACTION_BINDING_V1_TRIGGER_TYPE_ONE_SHOT); + + return cmd_results_new(CMD_SUCCESS, NULL); +} |