9 bool file_exists(const char* file_name) {
10 ifstream test_file(file_name);
11 return (bool)test_file;
14 void winch_handler(int signum) { // handle terminal resize
18 int main(int argc, char** argv) {
20 signal(SIGWINCH, winch_handler);
22 // read command line args
24 cout << "Taskasaur options\n-o [board_name]\n-n [new_board+name]";
29 while ((flag = getopt(argc, argv, "o:n:")) != -1) {
32 char* file_name = optarg;
33 printf("Opening %s\n", file_name);
35 // check if file exists
36 if (!file_exists(file_name)) {
37 printf("%s does not exist.\n", file_name);
41 } else if (flag == 'n') {
43 char* new_file_name = optarg;
44 printf("Creating %s\n", new_file_name);
46 if (file_exists(new_file_name)) {
47 printf("The board %s already exist.\n", new_file_name);
52 new_file.open(new_file_name);
53 new_file << "# Taskasaur\n";
68 init_pair(1, COLOR_CYAN, COLOR_BLACK);
69 init_pair(2, COLOR_BLACK, COLOR_CYAN);
72 getmaxyx(stdscr, height, width);
74 WINDOW * win = newwin(10,20,5,10);
75 WINDOW * todo_win = newwin(20,20,5,35);
76 WINDOW * bottombar = newwin(1,width,height-1,0);
82 string todo_list[3] = {"Contemplate life", "Question life", "Ponder about life"};
87 //ofc the first thing we need is vim keys
102 if (ch == 113) break; // q for quit
105 wattron(win,COLOR_PAIR(1));
106 wattron(win, A_BOLD);
107 mvwprintw(win, 0, 1, "lmao");
108 wattroff(win, A_BOLD);
109 wattroff(win,COLOR_PAIR(1));
110 mvwprintw(win, 1, 2, "poopoopeepee");
113 for (int i = 0; i < sizeof(todo_list)/sizeof(string); i++) {
114 mvwprintw(todo_win, 2*i, 0, todo_list[i].c_str());
118 wbkgd(bottombar, COLOR_PAIR(2));
119 mvwprintw(bottombar, 0, 2, "BOTTOM TEXT");