+ add_desktop(mon, make_desktop(name));
+ } else if (strcmp(cmd, "remove_desktop") == 0) {
+ for (char *name = strtok(NULL, TOK_SEP); name != NULL; name = strtok(NULL, TOK_SEP)) {
+ desktop_location_t loc;
+ if (locate_desktop(name, &loc)) {
+ if (loc.desktop->root == NULL && loc.monitor->desk_head != loc.monitor->desk_tail) {
+ remove_desktop(loc.monitor, loc.desktop);
+ desktop_show(loc.monitor->desk);
+ }
+ }
+ }
+ update_current();
+ } else if (strcmp(cmd, "send_desktop_to") == 0) {
+ if (mon->desk_head == mon->desk_tail)
+ return;
+ char *name = strtok(NULL, TOK_SEP);
+ if (name != NULL) {
+ monitor_t *m = find_monitor(name);
+ if (m != NULL && m != mon) {
+ char *opt = strtok(NULL, TOK_SEP);
+ send_option_t o;
+ if (!parse_send_option(opt, &o))
+ return;
+ desktop_t *d = mon->desk;
+ transfer_desktop(mon, m, d);
+ if (o == SEND_OPTION_FOLLOW)
+ focus_node(m, d, d->focus);
+ else if (o == SEND_OPTION_DONT_FOLLOW)
+ update_current();
+ }
+ }