Partially implement move command

Works:

- move [container|window] to workspace <name>
    - Note, this should be able to move C_CONTAINER but this is untested
- move [workspace] to output [left|right|up|down|<name>]

Not implemented yet:

- move [left|right|up|down]
- move scratchpad
- move position
This commit is contained in:
Drew DeVault 2018-03-31 21:21:26 -04:00
parent 122b96abed
commit b2d871cfe2
12 changed files with 268 additions and 41 deletions

View file

@ -1,3 +1,4 @@
#include <strings.h>
#include "sway/tree/container.h"
#include "sway/tree/layout.h"
#include "sway/output.h"
@ -37,3 +38,13 @@ struct sway_container *container_output_destroy(struct sway_container *output) {
container_destroy(output);
return &root_container;
}
struct sway_container *output_by_name(const char *name) {
for (int i = 0; i < root_container.children->length; ++i) {
struct sway_container *output = root_container.children->items[i];
if (strcasecmp(output->name, name) == 0){
return output;
}
}
return NULL;
}