moved to c
[taskasaur.git] / main.c
1 #include <stdio.h>
2 #include <ncurses.h>
3 #include <signal.h>
4 #include <unistd.h>
5
6 int main(int argc, char** argv) {
7
8     // start ncurses 
9     initscr();
10     cbreak();
11     /* raw(); */
12     noecho();
13     start_color();
14     
15     init_pair(1, COLOR_CYAN, COLOR_BLACK); 
16     init_pair(2, COLOR_BLACK, COLOR_CYAN); 
17
18     int height, width;
19     getmaxyx(stdscr, height, width);
20
21     WINDOW * win = newwin(10,20,5,10); 
22     WINDOW * todo_win = newwin(20,20,5,35);
23     WINDOW * bottombar = newwin(1,width,height-1,0); 
24     refresh();
25     
26     int x, y;
27     x = y = 0;
28
29     while (true) {
30         int ch = getch();
31         
32         //ofc the first thing we need is vim keys 
33         switch (ch) {
34             case 104: // h
35                 x -= 1;
36                 break;
37             case 106: // j
38                 y += 1;
39                 break;
40             case 107: // k
41                 y -= 1;
42                 break;
43             case 108: // l
44                 x += 1;
45                 break;
46         } 
47         if (ch == 113) break; // q for quit
48
49         box(win, 0, 0);
50         wattron(win,COLOR_PAIR(1));
51         wattron(win, A_BOLD);
52         mvwprintw(win, 0, 1, "lmao");
53         wattroff(win, A_BOLD);
54         wattroff(win,COLOR_PAIR(1));
55         mvwprintw(win, 1, 2, "poopoopeepee");
56         wrefresh(win);
57
58         wrefresh(todo_win);
59
60         wbkgd(bottombar, COLOR_PAIR(2));        
61         mvwprintw(bottombar, 0, 2, "BOTTOM TEXT");
62         wrefresh(bottombar);
63
64         move(y,x);
65         refresh();
66         /* clear(); */
67     }
68
69     endwin();
70     return 0;
71 }