1 #include "jDockApp/jDockApp.h"
2 #include "jDockApp/colors.h"
9 printf("-s <sec>: Seconds between executions of mailchk\n");
10 printf("-r : Don't show the read mail stat.\n");
15 void setup(int argc, char** argv) {
18 while( -1 != (c = getopt(argc, argv, "hrs:"))) {
21 case 'h': show_help();
23 case 'r': dontread = 1; break;
24 case 's': i=atoi(optarg); break;
27 set_update_delay((i) ? i : 15); /* seconds */
28 set_loop_delay(1000); /* mu seconds */
32 int i, new, tot, read;
34 FILE *f = popen("mailchk", "r");
35 fscanf(f, "%i - %i - %i", &new, &tot, &read);
40 jpprintf(0, 0, YELLOW, " J-mail");
42 jpprintf(1, 2, BLUE, "New", new);
45 jpprintf(7, 2, RED, "%i", new);
47 jpprintf(7, 2, CYAN, "%i", new);
51 jpprintf(1, 3, BLUE, "Read", read);
53 jpprintf(7, 3, CYAN, "%i", read);
56 jpprintf(1, 4, BLUE, "Total", tot);
58 jpprintf(7, 4, CYAN, "%i", tot);
65 void do_button_release() {