diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-04-30 17:08:25 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-04-30 15:22:02 -0600 |
commit | 13cbb3b7fca490cb7356de964d73ac3506c5f407 (patch) | |
tree | 59df06054c54f80fe95f307eedea7ec49662cc3a | |
parent | 3b3e0560beb9a44f038736fd4c344052fdfe3f81 (diff) |
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.
-rw-r--r-- | sway/commands/move.c | 9 | ||||
-rw-r--r-- | sway/sway.5.scd | 6 |
2 files changed, 12 insertions, 3 deletions
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; diff --git a/sway/sway.5.scd b/sway/sway.5.scd index 9fe51c33..32631b06 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd @@ -206,7 +206,7 @@ set|plus|minus <amount> *move* [container|window] [to] workspace back_and_forth Moves the focused container to previously focused workspace. -*move* [container|window] [to] output <name-or-id> +*move* [container|window] [to] output <name-or-id>|current Moves the focused container to the specified output. *move* [container|window] [to] output up|right|down|left @@ -216,10 +216,10 @@ set|plus|minus <amount> *move* [container|window] [to] scratchpad Moves the focused container to the scratchpad. -*move* workspace [to] output <name-or-id> +*move* workspace [to] output <name-or-id>|current Moves the focused workspace to the specified output. -*move* workspace to [output] <name-or-id> +*move* workspace to [output] <name-or-id>|current Moves the focused workspace to the specified output. *move* workspace [to] output up|right|down|left |