From 13cbb3b7fca490cb7356de964d73ac3506c5f407 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 30 Apr 2019 17:08:25 -0400 Subject: cmd_move: add support for output current This adds support for the following commands for i3 compatibility: - `move [window|container] [to] output current` - `move workspace to [output] current` - `move workspace [to] output current` The above commands are only useful when used with criteria. --- sway/commands/move.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sway/commands') diff --git a/sway/commands/move.c b/sway/commands/move.c index 4dec889c..9c6e69ec 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -28,6 +28,15 @@ static const char expected_syntax[] = static struct sway_output *output_in_direction(const char *direction_string, struct sway_output *reference, int ref_lx, int ref_ly) { + if (strcasecmp(direction_string, "current") == 0) { + struct sway_workspace *active_ws = + seat_get_focused_workspace(config->handler_context.seat); + if (!active_ws) { + return NULL; + } + return active_ws->output; + } + struct { char *name; enum wlr_direction direction; -- cgit v1.2.3