diff options
-rw-r--r-- | sway/commands/seat.c | 12 | ||||
-rw-r--r-- | sway/commands/seat/attach.c | 3 | ||||
-rw-r--r-- | sway/sway-input.5.scd | 9 | ||||
-rw-r--r-- | swaybar/tray/icon.c | 2 |
4 files changed, 20 insertions, 6 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"); } diff --git a/sway/commands/seat/attach.c b/sway/commands/seat/attach.c index 1e509a58..7615eef9 100644 --- a/sway/commands/seat/attach.c +++ b/sway/commands/seat/attach.c @@ -12,6 +12,9 @@ struct cmd_results *seat_cmd_attach(int argc, char **argv) { if (!config->handler_context.seat_config) { return cmd_results_new(CMD_FAILURE, "No seat defined"); } + if (config->reading) { + return cmd_results_new(CMD_DEFER, NULL); + } struct seat_attachment_config *attachment = seat_attachment_config_new(); if (!attachment) { diff --git a/sway/sway-input.5.scd b/sway/sway-input.5.scd index 88b4347a..376e1833 100644 --- a/sway/sway-input.5.scd +++ b/sway/sway-input.5.scd @@ -140,10 +140,11 @@ Configure options for multiseat mode. A *seat* is a collection of input devices that act independently of each other. Seats are identified by name and the default seat is _seat0_ if no seats are -configured. Each seat has an independent keyboard focus and a separate cursor that -is controlled by the pointer devices of the seat. This is useful for multiple -people using the desktop at the same time with their own devices (each sitting -in their own "seat"). +configured. While sway is running, _-_ (hyphen) can be used as an alias for the +current seat. Each seat has an independent keyboard focus and a separate cursor +that is controlled by the pointer devices of the seat. This is useful for +multiple people using the desktop at the same time with their own devices (each +sitting in their own "seat"). *seat* <name> attach <input_identifier> Attach an input device to this seat by its input identifier. A special diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c index ed152be5..bf2736c2 100644 --- a/swaybar/tray/icon.c +++ b/swaybar/tray/icon.c @@ -135,7 +135,7 @@ static int entry_handler(char *group, char *key, char *value, theme->name = strdup(value); } else if (strcmp(key, "Comment") == 0) { theme->comment = strdup(value); - } else if (strcmp(key, "Inherists") == 0) { + } else if (strcmp(key, "Inherits") == 0) { theme->inherits = strdup(value); } else if (strcmp(key, "Directories") == 0) { theme->directories = split_string(value, ","); |