diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-02-03 09:53:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-03 09:53:37 +0100 |
commit | b41f9f9158e2b47e85fe4933bfad65a1dcc1de03 (patch) | |
tree | 31c09cd8494181855545ae00ddaad3328708af1f /sway/commands/seat.c | |
parent | 1bd7400c4db2cc9cb020326b574941c040cc37fe (diff) | |
parent | f425e81fbe1340a1193ae98ff2081bd32facb9da (diff) |
Merge pull request #3554 from RedSoxFan/seat-current-alias
cmd_seat: allow - to be used as alias for current
Diffstat (limited to 'sway/commands/seat.c')
-rw-r--r-- | sway/commands/seat.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/commands/seat.c b/sway/commands/seat.c index 81bb5f5d..5b23dcc6 100644 --- a/sway/commands/seat.c +++ b/sway/commands/seat.c @@ -2,6 +2,7 @@ #include <strings.h> #include "sway/commands.h" #include "sway/input/input-manager.h" +#include "sway/input/seat.h" #include "log.h" #include "stringop.h" @@ -20,7 +21,16 @@ struct cmd_results *cmd_seat(int argc, char **argv) { return error; } - config->handler_context.seat_config = new_seat_config(argv[0]); + if (!strcmp(argv[0], "-")) { + if (config->reading) { + return cmd_results_new(CMD_FAILURE, + "Current seat alias (-) cannot be used in the config"); + } + config->handler_context.seat_config = + new_seat_config(config->handler_context.seat->wlr_seat->name); + } else { + config->handler_context.seat_config = new_seat_config(argv[0]); + } if (!config->handler_context.seat_config) { return cmd_results_new(CMD_FAILURE, "Couldn't allocate config"); } |