mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 17:31:28 +00:00
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.
This commit is contained in:
parent
3b3e0560be
commit
13cbb3b7fc
|
@ -28,6 +28,15 @@ static const char expected_syntax[] =
|
||||||
|
|
||||||
static struct sway_output *output_in_direction(const char *direction_string,
|
static struct sway_output *output_in_direction(const char *direction_string,
|
||||||
struct sway_output *reference, int ref_lx, int ref_ly) {
|
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 {
|
struct {
|
||||||
char *name;
|
char *name;
|
||||||
enum wlr_direction direction;
|
enum wlr_direction direction;
|
||||||
|
|
|
@ -206,7 +206,7 @@ set|plus|minus <amount>
|
||||||
*move* [container|window] [to] workspace back_and_forth
|
*move* [container|window] [to] workspace back_and_forth
|
||||||
Moves the focused container to previously focused workspace.
|
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.
|
Moves the focused container to the specified output.
|
||||||
|
|
||||||
*move* [container|window] [to] output up|right|down|left
|
*move* [container|window] [to] output up|right|down|left
|
||||||
|
@ -216,10 +216,10 @@ set|plus|minus <amount>
|
||||||
*move* [container|window] [to] scratchpad
|
*move* [container|window] [to] scratchpad
|
||||||
Moves the focused container to the 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.
|
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.
|
Moves the focused workspace to the specified output.
|
||||||
|
|
||||||
*move* workspace [to] output up|right|down|left
|
*move* workspace [to] output up|right|down|left
|
||||||
|
|
Loading…
Reference in a new issue