}
}
-void parse_command(const char *command) {
- printf("received command: %s\n", command);
-
- if (strcasecmp(command, "open") == 0)
- tree_open_con(NULL);
- else if (strcasecmp(command, "close") == 0)
- tree_close_con();
- else if (strcasecmp(command, "split h") == 0)
- tree_split(focused, HORIZ);
- else if (strcasecmp(command, "split v") == 0)
- tree_split(focused, VERT);
- else if (strcasecmp(command, "level up") == 0)
- level_up();
- else if (strcasecmp(command, "level down") == 0)
- level_down();
- else if (strcasecmp(command, "prev h") == 0)
- tree_next('p', HORIZ);
- else if (strcasecmp(command, "prev v") == 0)
- tree_next('p', VERT);
- else if (strcasecmp(command, "next h") == 0)
- tree_next('n', HORIZ);
- else if (strcasecmp(command, "next v") == 0)
- tree_next('n', VERT);
- else if (strncasecmp(command, "workspace ", strlen("workspace ")) == 0)
- workspace_show(command + strlen("workspace "));
- else if (strcasecmp(command, "stack") == 0) {
- focused->layout = L_STACKED;
- }
- else if (strcasecmp(command, "fullscreen") == 0) {
- if (focused->fullscreen_mode == CF_NONE)
- focused->fullscreen_mode = CF_OUTPUT;
- else focused->fullscreen_mode = CF_NONE;
- }
- else if (strcasecmp(command, "move before h") == 0)
- tree_move('p', HORIZ);
- else if (strcasecmp(command, "move before v") == 0)
- tree_move('p', VERT);
- else if (strcasecmp(command, "move after h") == 0)
- tree_move('n', HORIZ);
- else if (strcasecmp(command, "move after v") == 0)
- tree_move('n', VERT);
- else if (strncasecmp(command, "restore", strlen("restore")) == 0)
- tree_append_json(command + strlen("restore "));
- else if (strncasecmp(command, "exec", strlen("exec")) == 0)
- start_application(command + strlen("exec "));
- else if (strcasecmp(command, "restart") == 0)
- i3_restart();
- else if (strcasecmp(command, "floating") == 0) {
- //toggle_floating_mode(focused, false);
- parse_cmd("exit");
- parse_cmd("exec /usr/bin/bleh");
- parse_cmd("exec kill -9 33");
- parse_cmd("kill");
- parse_cmd("[ class=\"Xpdf\" ] kill");
- parse_cmd("[ class=\"firefox\" ] kill");
-
- }
-
- tree_render();
-
-#if 0
- if (strcasecmp(command, "prev") == 0)
- tree_prev(O_CURRENT);
-#endif
-}
-
int main(int argc, char *argv[]) {
//parse_cmd("[ foo ] attach, attach ; focus");
int screens;